Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2680001pxf; Sun, 4 Apr 2021 10:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAg7+YT41GuhchapTXXkIHO3pFZ1rqHYyMhnt1oaeQBSSVD0IRLBe5bOVu49qD8Zuk83Hp X-Received: by 2002:a02:6a5a:: with SMTP id m26mr20545224jaf.17.1617556004630; Sun, 04 Apr 2021 10:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617556004; cv=none; d=google.com; s=arc-20160816; b=ZxCO5NSFHZ+vEUvDoM/c33v15Bz/QfDBWXhSo1IoViqv5Pe6fn6nUssOUYrbIJ3+Wc w1MLA8wRODkigzryW0m2V0a2FbLXrmwmc9bBO1AWItnW/ayfRvwI7YhZG/McfIsfWhkc xeF/xqpNTSIGjDgkz5uK0XSeoHod6X9bZiQP3AdsfxYDOvKLugJb2X4R9rZuVVluPT5g te+JNs7amP8u6OiMvVpqT+3mys5Sxd+U/u2jJg8aPg+GdSQIRWTjcHiHRmrx+Nn2Xxfr +3LJ2uHYUN2W5wPRiEJjo7eDFuqOuw42iJmyL8SsjlDn/RraNKR5UvwbUmyWi9SSfmTn 9iWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=iud/EEIeRU3gV7QSbsRbgqiClFQNRhYxlOzrWHnivqc=; b=tYU6FbE913UkZuiOhHU+Rxoh3S/4CoeCKESg9lYGThy0tmsUhZ/bdDKfwGHPxlp01Y agxuSScJQ3aymmG75OY68ajpGzBeut27A1TkgSHhyXE75yoVltyqKZvIrNOlxJEOzVJ7 nCmJPKoUw7DJAmPk9zVvPwLjUCLglRWanIU+cGydbNReDfbdCG5V38XnPm1Sl1Ph7dVf E5T9BLtV5ticNSkK0H+r7Fe1RPkXevcruH/s5fUq7F2aPdpkek3X0ps0Tk5LCXdPaau/ iO6GKYH8b4/fySjGzqBdVNYyqW1qDSH3IdWr5T5I8TIMQXbjP3a4Zf88Q4tAdodVwJQ/ /Djg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si7440733ild.152.2021.04.04.10.06.29; Sun, 04 Apr 2021 10:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231152AbhDDRFZ (ORCPT + 99 others); Sun, 4 Apr 2021 13:05:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:60100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbhDDRFY (ORCPT ); Sun, 4 Apr 2021 13:05:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDBC96128B; Sun, 4 Apr 2021 17:05:16 +0000 (UTC) Date: Sun, 4 Apr 2021 19:05:13 +0200 From: Christian Brauner To: Al Viro Cc: Jens Axboe , syzbot , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, io-uring@vger.kernel.org Subject: Re: [syzbot] WARNING in mntput_no_expire (2) Message-ID: <20210404170513.mfl5liccdaxjnpls@wittgenstein> References: <20210401154515.k24qdd2lzhtneu47@wittgenstein> <90e7e339-eaec-adb2-cfed-6dc058a117a3@kernel.dk> <20210401174613.vymhhrfsemypougv@wittgenstein> <20210401175919.jpiylhfrlb4xb67u@wittgenstein> <20210404113445.xo6ntgfpxigcb3x6@wittgenstein> <20210404164040.vtxdcfzgliuzghwk@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 04, 2021 at 04:44:06PM +0000, Al Viro wrote: > On Sun, Apr 04, 2021 at 06:40:40PM +0200, Christian Brauner wrote: > > > > Very interesting. What happens if you call loop() twice? And now I wonder > > > whether it's root or cwd, actually... Hmm... > > > > > > How about this: > > > fd = open("/proc/self/mountinfo", 0); > > > mkdir("./newroot/foo", 0777); > > > mount("./newroot/foo", "./newroot/foo", 0, MS_BIND, NULL); > > > chroot("./newroot"); > > > chdir("/foo"); > > > while (1) { > > > static char buf[4096]; > > > int n = read(fd, buf, 4096); > > > if (n <= 0) > > > break; > > > write(1, buf, n); > > > } > > > close(fd); > > > drop_caps(); > > > loop(); > > > as the end of namespace_sandbox_proc(), instead of > > > chroot("./newroot"); > > > chdir("/"); > > > drop_caps(); > > > loop(); > > > sequence we have there? > > > > Uhum, well then we oops properly with a null-deref. > > Cute... Could you dump namei.o (ideally - with namei.s) from your build > someplace public? Yeah, I have at least namei.o https://drive.google.com/file/d/1AvO1St0YltIrA86DXjp1Xg3ojtS9owGh/view?usp=sharing Christian