mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Christian Brauner <brauner@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	NeilBrown <neil@brown.name>, Jiri Olsa <jolsa@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	linux-fsdevel@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH vfs v2] bpf: Allow bpf_d_path() from filp_close_sync()
Date: Wed, 21 Oct 2026 10:15:01 -0700	[thread overview]
Message-ID: <9bb73098-57c1-4754-9ecb-66cbb1e205ee@linux.dev> (raw)
In-Reply-To: <20261021-ananas-siegen-kurstadt-24cc3e5c1ce6@brauner>

On 2026-10-21 1:54 a.m., Christian Brauner wrote:
> On Fri, Sep 25, 2026 at 02:03:47PM -0700, Ihor Solodrai wrote:
>> The d_path selftest closes its descriptors with close_range() so that
>> its fentry program on filp_close() runs. The vfs commit
>> c1ed65ea167b ("fs: make close_range() synchronous") switched
>> close_range() to filp_close_sync(), so the program still attaches but
>> is never called:
>>
>>    test_d_path_basic:FAIL:close trampoline for filp_close was not called
>>
>> With that series, close(), close_range() and the closes on exec and
>> exit all go through filp_close_sync(). Few paths still reach
>> filp_close(), dup2() being one of them, so a program on filp_close()
>> no longer sees most file closes.
>>
>> Allow bpf_d_path() from filp_close_sync(), but only from fentry.
>> filp_close_sync() drops the last file reference inline, so by the time
>> an fexit program runs, file->f_path may already be freed, with no RCU
>> delay for NORCU dentries such as pipes and sockets.
>>
>> Attach the selftest program to filp_close_sync() and keep triggering
>> it with close_range().
>>
>> Add a test rejecting bpf_d_path() from fexit/filp_close_sync.
>>
>> Assisted-by: LLM
>> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
>>
>> ---
> 
> This seems fine to me. Sashiko has some comments though.
> Maybe go through them and resend as necessary.

I looked at them when sashiko replied and dismissed.
Should've commented.

I'll respin anyways to rebase, it's been a month.

Thanks for taking a look.


      reply	other threads:[~2026-10-21 17:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 21:03 Ihor Solodrai
2026-10-21  8:54 ` Christian Brauner
2026-10-21 17:15   ` Ihor Solodrai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bb73098-57c1-4754-9ecb-66cbb1e205ee@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=broonie@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=jack@suse.cz \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=neil@brown.name \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®