From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.224.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792505157; b=lGEWqZ382T36OUqqSfqXe9Z4ml+1gLR7DdC+F0XnPhvi2sCflAcm19eBB/0fV7ZGHkoN ZaEy2ElcVyy6v4ANBohnCYOxlS5nq+8Ig7iy2rgPfpn8LsPCvW+3fspFKXNO+XJPRNrla UvHAbaylBGH+fPlADtrok/Y/SM+GaaEqbNd0GQ4oTFrYFOX6Z49xNwEYD6js8o2UQJrw+ RPEk0LN9Tk4ym1R+ii5s38FDSTA4G4K2nUPq6Kjg18SW1rgOZX2KUt+rersQwcCAfQVh5 /FIR19C/agxeCr5IAgz2MoMjwjP7M1vHTUAevIna1LLnMjxQxNDiDJXQaD7c8172cgw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792505157; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=LdMIhIlvZTbrlYO+3j4hIx5IHxpdtNc/p0dXdNrCqlg=; b=E4WNE2nuJJ34DVy1WTRfFWsFHEnTkthuo6WlZd+71IrTcJp2WrCMGv0vuQL+UGe1qXXJ Nh8menww9JvV8Lpq7yzq6q49gZVA8smPW5Wb6lmgzHEuYbw6QK7CukyUnMvCsqU+UVHEY UIUE4cbWO4Qaoo94QP/4Mp9ht4Eftz4/j/LIOj517J04r8gwNMYtg7kjQKePfX37Jal8J jMOPTTJHIwQdQ9VZxc/S7J2CAkFO6oLiZPWO0/H+ku6krUkLED+Ofoc6jsWM+AVNGQ0TF LNSv+WJv7WGBKQBKt3g2ie/6bfuE6ONE0QbNE5VSnCA0JK/9UwbLWYAWHrXRdeAZwwg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=NU6pBVdp; arc=none smtp.remote-ip=74.125.224.52 Received: from mail-yx1-f52.google.com (mail-yx1-f52.google.com [74.125.224.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EAAF60A262E for ; Tue, 20 Oct 2026 14:05:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2EAAF60A262E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=NU6pBVdp Received: by mail-yx1-f52.google.com with SMTP id 956f58d0204a3-6711f05fb14so2602428d50.2 for ; Tue, 20 Oct 2026 07:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792505156; x=1793109956; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=LdMIhIlvZTbrlYO+3j4hIx5IHxpdtNc/p0dXdNrCqlg=; b=NU6pBVdpXdS4zzTYissdBw/MDiiN5o5TlNwj//ZWFnIayDvxx9gDu9+hdW70Te0AMR lJOPDNX3EmmlHKf5SjsRkfUSpS3+vwRua3DVosyQsGKHGKo8S+9RGOYoBbLl8ZOPexOA xzzglLS59r9xTw+UX43wdSNz+zCsYBznrlPO1wxAJjJ4ycSSJkzbxvTL8dKWPvUT1ygb zxmJFdEkKjhoPc+3QVIuFZWAzX+hKcUJT4cDBEGwXNO0XgunVCxvpiHtJFEnynNZm9WC 9StBMW9IYTJjpXxeP7pcleHsubJyMN/oKAkLJ5fmcxcdypeboIphMuGXqduwxNwTdvi8 u7vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792505156; x=1793109956; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=LdMIhIlvZTbrlYO+3j4hIx5IHxpdtNc/p0dXdNrCqlg=; b=RGHYaT9l/pVBqmDcTVVRRuGCltu6xjV7Y5h5hEUuefbSC8ApHHuhP6gdIK0pTKnSxK 4UkwOQIsAiTphDknu1gmPZTsfNDn2t1c+zSNhINIkeNjBvYpkTccCKRLDRWtYi9qpfF0 TFm6VDwEgsyhdXILMSvOllPna9enIs3J5rYoQ3cyxgowBOQG8NO0upjKE92oh1sOBn5J 9IOFfQ6zNUPTRL9AZiEV2Ir/KZngfX6P4RO0D4JndqNYUfCXoKZfNN2N7fFE3d5wF1pZ tDPKQmQsW57cPI1XlAVbMJsNozT05mw04hzLv+nUJSnlT3v1tJKpQ1wdedQt0iBEQ7z+ LqJQ== X-Forwarded-Encrypted: i=1; AKwUvBz87wUGoG91m3rxL9YhsWvyINhokbAEfebDD+p800fGuG12MGhgIHjgngECd/OcLNFADh8/AiEJvLApdUcW@vger.kernel.org X-Gm-Message-State: AFq9FYKxV72dmm3JeET3X86Q4ZxvDoSnj86lokraGdYOaN8AcB4uOq0X +2uKMpPNcT3hm38tpx6QcHzFc5vNOdatDxk1oVeQQhzQfwbQE+VDLvkS X-Gm-Gg: AYBFou2apftY6yWFKySHQyWxEqVNzbkMZC/v+2rQzT0vgWQtxHjoZlz0HIXey9ym6g+ Pn5JD3Lt/uOfgNAk5Wh0N6JhyHBllpJC0LFYxjJBe6NXLx5e+xbNo2Lp+gL5PjQTvvxwWQpwQD/ ySCngRbzFzA/+JOpxRf2MCZNT7Kd+QgdWT6j9NTceyhcNbsuIJawBfknXfdRV4rnq0ZLsUZv1Op tHnR5es6dz9+ap1xe0xgSXXZJ+VqN1nCHZXC6ln9KqsQf+U36cqk6FDrEt0yXUMXrtIFS12gvRI iDbLuLSQxCbltZQ6YvQLLf794abf0RZVBaqp/0ubQW2s2zT8cA3K5p+NA/jC/G9l/zjT9TfIZGa U83E/mLvqsKJDTIcAjh+2MjbcLl9TRo6VL++pYLwFqjJo4opFEH+KbFuB59SgWcubaeopQEJnyT EkK3Htc1PPbetRZZEuUEUPULG5Q/UJBETN/DYit/D0h9nftJh1Ay169NpzSNtGBa10A0g8JJc= X-Received: by 2002:a05:690e:1443:b0:679:aeed:8900 with SMTP id 956f58d0204a3-679ca7343eamr4757054d50.22.1792505156161; Tue, 20 Oct 2026 07:05:56 -0700 (PDT) Received: from zenbox ([2600:1700:18fb:6011:8701:205:573e:17eb]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-679b1c94c25sm5269200d50.3.2026.10.20.07.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2026 07:05:55 -0700 (PDT) Date: Tue, 20 Oct 2026 10:05:54 -0400 From: Justin Suess To: Alexei Starovoitov Cc: Christian Brauner , Alexander Viro , Jan Kara , NeilBrown , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , Daniel Borkmann , Andrii Nakryiko , Song Liu , linux-fsdevel@vger.kernel.org, bpf@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?Q?G=C3=BCnther?= Noack , Paul Moore , James Morris , "Serge E . Hallyn" , Martin KaFai Lau , Eduard Zingerman , Yonghong Song , John Fastabend , Kumar Kartikeya Dwivedi , Jiri Olsa , Jeff Layton , Amir Goldstein , Mateusz Guzik , Shuah Khan , Tingmao Wang Subject: Re: [PATCH bpf-next v1 00/11] fs: unified VFS ancestor walk for Landlock and BPF Message-ID: References: <20261013164800.2906577-1-utilityemal77@gmail.com> X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, Oct 17, 2026 at 01:02:40AM +0000, Alexei Starovoitov wrote: > On Tue, Oct 13, 2026 at 12:47 PM Justin Suess wrote: > > The structure is unchanged from the RFC [2]: a stepwise engine private > > to namei.c, a callback front-end for in-kernel callers (Landlock > > is converted, fixing the follow_up() race Al reported, hence the > > Fixes: tag on patch 3), and open-coded BPF iterators over the engine in > > referenced and rcu flavors, with bpf_path_ancestors_legitimize() > > escalating from the latter to the former mid-walk. Patch 1 is carried > > from Song's series. See the RFC cover for the full background and API > > listing. > > Song's series stopped at > "It is a conceptual dead-end to expose these two modes via separate APIs > and leak this implementation detail into non-core code. It will not > happen as far as I'm concerned." > VFS_WALK_RCU, -ECHILD to the caller, two bpf iterators and the > legitimize kfunc are that leak. Following up on this, plan is I'll submit v2 of the verifier fixes series and get that finished first. Then after that I'll do a redesign around a single iterator implementation that decides the walk type and abstracts away the details. It will be KF_RCU_PROTECTED and callers will need to break out of the loop to do sleepable work. They'll be able to acquire the path references with a kfunc to take them out of the loop. That drops the __uninit iterator changes and the legitimize kfunc as well. > Landlock still passes flags == 0, so nothing in the kernel walks in > rcu mode. Mickaël would you be interested in the hybrid walk conversion as part of this series? Or prefer sleepable walk be retained for now and converted later? Justin > Patches 1-3 fix a real race and don't need bpf. > Send them to Christian, Al and Mickael on their own. > > > Verifier fixes propagating the RCU-ness to trusted fields can be done, > > but it's best as a separate series where the idea can be examined more > > closely. Then marking the dentry as trusted will allow you to use the > > dentry xattr kfuncs. Nothing in this series strictly depends on having > > a trusted dentry, nor will marking it trusted require changes in this > > API. See my follow up [4]. > > Then what can a prog do with a position? > pos->dentry is untrusted now. > Marking it trusted will require changes. > d = pos->dentry is not linked to pos. It will stay trusted after > bpf_path_put(pos). > pos of the rcu iterator points into bpf stack. > MEM_RCU propagation fixes neither. > What next() should return depends on how the verifier tracks it. > Let's do the verifier part first. > > pw-bot: cr