Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2670205pxf; Sun, 4 Apr 2021 09:44:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxURu0YNfRB2xF9fW2A88lnN/zBglth2tBavmkUNFQ9vX3s2My5s8vvADwdqxDCrbf80xWj X-Received: by 2002:a05:6602:8dd:: with SMTP id h29mr17174514ioz.93.1617554686344; Sun, 04 Apr 2021 09:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617554686; cv=none; d=google.com; s=arc-20160816; b=VwAmCZwZv3vjdOROmiEC0pKnTOU5/Gt+kc0kqaAwSshqDTfffD5nAltp5h7jnXGGk+ PZWnZZUxCAKMBmDM/7l0uCFBesOf2gg+AiMIhVhn9v9IGpoL7EgNEvJ1awnGNttj3sK6 /TJlYhbqjOuz4571/1D6Bj/rSxugmstGnfl9xbA9SzKEfdbH7WcUXwfoqLTVjl0dcSfC /wbNnDmV6XnF/PY01VZNA/sgU0j9rYJyiJt4QBAIlDXmotwQCbhmeE3pkjRgf2Y4uuuJ hzprccTxAmDsiA62Xd2ZN1iapNTgelwbujFS9qEGMGGVfaj2hGVu1W22ekOTALhjaN81 acTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=t2GiNMVQga9ENcWzsE8MMsK2nviqu2v/X4OSTIg7zyI=; b=QX9sGoLKw4aeo854yJkuW1Dp9Ghb3Y2vnDax86rXD9tTh0VoFwEglKFxJDB66QcVYM jVw4UALgzaO2qhE8eMdVjt2sOG6oaSXjU5pHdjZjS2YWgtUYLmVEr9GdTFh3tcnZ/JOQ XnCh0u3tnXRgegtpErjvTcqmGVRz58R2DQXtY1a1r7e6iZQAWpmVjNOPKIDlZfx9R20/ iEpQOb/rDxzCASO5ciRTT6h+LJUIRo0Y5dWNwTA9jbRpxxsGLYKccgCh3cz0IJOYSEF6 eDXc9Lz2vokWP6FMKzn0hc7nXpMgXxBbBiMVWixIuc3gZ+93xApFdYokKkSZOYmjF1ul e4Og== 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.09.44.32; Sun, 04 Apr 2021 09:44:46 -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 S231144AbhDDQoO (ORCPT + 99 others); Sun, 4 Apr 2021 12:44:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbhDDQoO (ORCPT ); Sun, 4 Apr 2021 12:44:14 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0374C061756; Sun, 4 Apr 2021 09:44:09 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lT5r4-002V2g-3Z; Sun, 04 Apr 2021 16:44:06 +0000 Date: Sun, 4 Apr 2021 16:44:06 +0000 From: Al Viro To: Christian Brauner 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: References: <0000000000003a565e05bee596f2@google.com> <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=us-ascii Content-Disposition: inline In-Reply-To: <20210404164040.vtxdcfzgliuzghwk@wittgenstein> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?