From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792774252; b=Ug4KOWqTAie8HlQv17BBtY24WyhpIyHmxRX43AjmP/i2Mb8ytZQPv3acCS40tWG7u4P7 92XJ+tMi3iOUgnbGKBv1u4zr6BNrSVuY/BlHs6OUTTC22cnRqbxZKb+bWBPjgb9/7Luux iXq/nHGSt0OxMxFR4e34BGuUWlrhKlh+vbF7W5Ja/TuTZ2ULHE/0xGG9b24t2rueBqshe 8i7TVBEbhCYtqNZrOOc/2DUUZS7wS98DLCTzT2rpSjiuYZGqo7/crhfGyDg7J89vBaCVg Z/q1q8VTW0cdzj0fC0FGZCtCEnTCoIF0m/8JFSNbg1X+iLye/Dpqz24auY6LTRHb8EQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792774252; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:From:To:Cc:References:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=GCz40g1guEeoJS/oqADgwojm7pc6elU5aYlmpqlNJXU=; b=nc62f+1uXvJi1YIEBJWctkwEbx0XYtGN+1lWbp+uS6z1c+ADIdyEwkUty2he7xm1LhKX B4lk88gwZdlxsg0fF722NSqgmaOaUwf3gyXwkqRqUD9IcDY5w0nXXboeYHRQrKO2Af3/5 dN64lwspKJeJ+mmd3nOO5DcCQxU139hp5odngtr17X3ETGm3jgG/M92jFh2GfewhT6qrQ KxsXo9W/b9Giu6OnhNDuJ+hSArRn5P8nT8yD/8TOLoteJfWs5gECPexA6r6O4sifJA5Ym 6QFzIevCnynpXqsMbKn5oxyLSAcQhAyPVJR48Rm5RNtF3Cks8oURKyrrUBVbrZOaasg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=EnYsLRBW; arc=none smtp.remote-ip=95.215.58.47 Received: from mta1.migadu.com (out-47.mta1.migadu.com [95.215.58.47]) (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 03276606A31A for ; Fri, 23 Oct 2026 16:50:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 03276606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=EnYsLRBW X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=efnr8bEjRz3wvGuIq/m5I2FsgQOeEhbbFO8QT7bbpds=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1792774244; v=1; x=1793379044; b=EnYsLRBWzSYhcvwW4OfLcNO6yUKdOiHpXWeF2prjikQafl2G00pwJAr+O91IgPRgx0G2jH9P mBrdmcyx5YocYr5MLuv8FLYapWHLdo6z6dLh1fqyJ3YIiPC4NcIEMcVh0g7AX96DRDZxGP5uEuS 5vE1GkcEx932vU89PjSducmg= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 008a056e11af6839; Fri, 23 Oct 2026 16:50:43 +0000 X-Mizu-Trace-ID: 008a056e11af6839 X-Migadu-Flow: FLOW_OUT Message-ID: <3e0cb7ec-4849-4986-a474-83f8ad98c1ee@linux.dev> Date: Fri, 23 Oct 2026 09:50:37 -0700 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH vfs v3] bpf: Allow bpf_d_path() from filp_close_sync() From: Ihor Solodrai To: Christian Brauner , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Eduard Zingerman , Kumar Kartikeya Dwivedi Cc: Alexander Viro , Jan Kara , NeilBrown , Jiri Olsa , Mark Brown , linux-fsdevel@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20261021201400.5409-1-ihor.solodrai@linux.dev> Content-Language: en-US In-Reply-To: <20261021201400.5409-1-ihor.solodrai@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 10/21/26 1:13 PM, Ihor Solodrai wrote: > The d_path selftest closes its descriptors with close_range() so that > its fentry program on filp_close() runs. > > Commit 056069eb2b66 ("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 > Fixes: 056069eb2b66 ("fs: make close_range() synchronous") > Signed-off-by: Ihor Solodrai Christian, Just in case you pay attention to BPF CI signals, they are red for this patch because commit 056069eb2b66 is not in bpf-next yet. Thanks. > [...]