Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2721648pxf; Sun, 4 Apr 2021 11:52:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ7uHzGUPSTdgNy6bJioaJJEqq+ic6soKB/Xss7WfCJp5zFFcI8GoMYykUlZUIeIN5KA/r X-Received: by 2002:a17:906:39cf:: with SMTP id i15mr24807667eje.534.1617562358384; Sun, 04 Apr 2021 11:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617562358; cv=none; d=google.com; s=arc-20160816; b=SnNvZV+RqSiaNjh//KNU6+/GlkJyxfI4pJOq33rC4F7dE2DPiXrIUphRBHPdXMYNKX Cer35oeBCPbDCn3KNMs0gK1t25un5cypM8pFBUH0M0/LzaqTa/tDarYNhNbcqrnayMiK lbqamZfsxpuDlQPy8KvBijGPt8OWqBclbi3E/T75NCT3k4wwqeN58jBORsp/hllSNOyO jNmkbMLPrw0MQPLbA5CxqmQL4AC/FuFKwT5JjbYM0hGGFFRg46tmDS2Uk2fycCxyqtYv 1UiNvO2XAn6tUOsFBcKmxVNMpAn+keG2RDtI6KrWUW8cxqyh768pU0E8brG/E1RDXjSl xQ2w== 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=06BcvEpDSAnnIpyPwqxHfYR9zXa/kAt2aKcyuwgp6rs=; b=Q0TL/8Mq4Iyk7bf84G/6NHd+To21AwJC7qIAxtZIGvwy/ht1BbASxcbS8aPHCDR/Ak 69sDf3w/9Ms4Q9bYt2iUWFwYorp1t8oNTRjQ45F6mwR/bfUQ1plPQyPYQbLLTk6sIgxN UagInOknWy0aghm8yINWnd255fTO3MjgG/uTY7xlh6M5sdlYx2LyWLf7/U3ezbeqpGt4 0EA5u6aZpHP09GF2PNU/VKzJuVFbotNRxf9sY3OFQwlnf5BDe38gI8UBLsf2JUpC6nMO 6tbn6UNvX122y7iUPbUoewP8GrAIvoLQcmS/3IoRixB1ZicDFlHn47QVUw2mdgRM8caX w9VQ== 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 by3si5688840edb.342.2021.04.04.11.51.41; Sun, 04 Apr 2021 11:52:38 -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 S231312AbhDDSuZ (ORCPT + 99 others); Sun, 4 Apr 2021 14:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbhDDSuX (ORCPT ); Sun, 4 Apr 2021 14:50:23 -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 1A2D2C061756; Sun, 4 Apr 2021 11:50:17 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lT7p4-002WW6-5i; Sun, 04 Apr 2021 18:50:10 +0000 Date: Sun, 4 Apr 2021 18:50:10 +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: <90e7e339-eaec-adb2-cfed-6dc058a117a3@kernel.dk> <20210401174613.vymhhrfsemypougv@wittgenstein> <20210401175919.jpiylhfrlb4xb67u@wittgenstein> <20210404113445.xo6ntgfpxigcb3x6@wittgenstein> <20210404164040.vtxdcfzgliuzghwk@wittgenstein> <20210404170513.mfl5liccdaxjnpls@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210404170513.mfl5liccdaxjnpls@wittgenstein> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 04, 2021 at 07:05:13PM +0200, Christian Brauner wrote: > 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 *grumble* Is it reproducible without KASAN? Would be much easier to follow the produced asm...