From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796100938; b=XGN6Nonq+rkQ/yLspW8NbURAxX3lBGnQlgMswMhmT8R5NqtPYY4tq8KRs4K8aSDlHFJX ZFjUYA8nwVrds3QBvBNPWepEcjqiXD6+rpGtopEA6oyy7DTESDmypSc0te9YOlPtxwUEg hvzLzqCqXo/67zJlU2KVKqUh4AqxrZIAvhnejHK3+0nf5t3SUlHLRxB9vRPdWZydaVudo xc0Qxna0VNR8eMa0SC+VajvvUqBJiFxUa8mY4ksw7VEY/Pwbe1hHth6N5X/0qstWuOUvg nZfulkrr2+quOfzhLhMGnyAXXOiLx1Cn4/VQxJjI/Y7UnOQpPAMpeBkz6HxbSrUWehA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796100938; h=Received:DKIM-Signature:Content-Type:MIME-Version:Message-Id: In-Reply-To:References:Subject:From:To:Cc:Date; bh=UZjrTA2szc22XkRJv3AQZ4GbPeRFWFT2cX6k3NPhDUw=; b=3LL0jAp8HvuB/+a2Run6idUiyA+exXQGW+x1f8GoBfgMMam+4aoaCbDTbhequ+b45oyY v5GUQzJYXoUxFq2lqyU/fXza5UxwIvFv2tHIpF1a8wO0YpdxV7FkpXMXQ7DE1Ut45BESg pMeVLmS+3CzMSmAWfDdV6hihanPbQmHoTHuysoh5jLJ6kdS2qaDIVSflN5gUfgW9qbNgg 4I4J3aW8feajTYuwd+hCBW6sx1CGsvQhaMEaCKAPhdoLmAJ4xIfwRIB6o1k4aoreT3pAO AXOazlNO0L2/DE+lGBWcrArRCtsE/xHY8OIoX/Q79KWlVVaN3Qhqj0uzzSv6kepm8Kg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WtNeQ88y; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F85D606A31A; Tue, 1 Dec 2026 04:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WtNeQ88y Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2AAE1F000C1; Tue, 1 Dec 2026 04:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796100937; bh=UZjrTA2szc22XkRJv3AQZ4GbPeRFWFT2cX6k3NPhDUw=; h=In-Reply-To:References:Subject:From:To:Cc:Date; b=WtNeQ88yqO9lwp6aQBLXG1bLg3IrWy4o9zFSlqMiMfJTiZXGWGRvwO3jQA41Ut1Gg SGu9EhTf3KrHPyPOs3w9KHA8Ad0Y/xmlFX0bY/5+uRA0iBHP0H36cWrmmgj3CCFYjg m2gORZFy1EcFclFJE165c6CX9S28zilmolW9NfAH1O0vgUUbO+/byF6JOxN9LR9mm8 mnQgg6z5hPJBYr0S00K53X0eg0MyRk3C9dyXWtiQC/qA692ekCsxVGz5psTtE4eDl5 prDgvXKd7ynflekk9Toueb6nUKgYleOWTjCS8JUPEwPmrnTqREt+4EAT7qqmI2cxBa OatJ1w87Od1+Q== Content-Type: multipart/mixed; boundary="===============8179807642073132361==" 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 Message-Id: <25bede665ab4f21aca96aa43bd8aa85d6f8e8af925dc3e232ed19433f0433418@mail.kernel.org> In-Reply-To: <20261201042201.3199928-7-song@kernel.org> References: <20261201042201.3199928-7-song@kernel.org> Subject: Re: [PATCH v3 06/22] u64_stats: Mark the update helpers used by BPF notrace From: bot+bpf-ci@kernel.org To: song@kernel.org,linux-kernel@vger.kernel.org,linux-trace-kernel@vger.kernel.org,live-patching@vger.kernel.org,linux-arch@vger.kernel.org,linux-arm-kernel@lists.infradead.org,linuxppc-dev@lists.ozlabs.org,linux-riscv@lists.infradead.org,bpf@vger.kernel.org Cc: rostedt@goodmis.org,mhiramat@kernel.org,mark.rutland@arm.com,peterz@infradead.org,tglx@kernel.org,frederic@kernel.org,paulmck@kernel.org,catalin.marinas@arm.com,will@kernel.org,maddy@linux.ibm.com,mpe@ellerman.id.au,npiggin@gmail.com,chleroy@kernel.org,pjw@kernel.org,palmer@dabbelt.com,aou@eecs.berkeley.edu,alex@ghiti.fr,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,ojeda@kernel.org,kernel-team@meta.com,song@kernel.org,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev Date: Tue, 1 Dec 2026 04:55:34 +0000 (UTC) --===============8179807642073132361== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit > u64_stats: Mark the update helpers used by BPF notrace TL;DR: The seqcount helpers called by the u64_stats helpers (32-bit/PREEMPT_RT) aren't marked notrace, so once plain inline stops implying notrace, an fentry program may possibly recurse from BPF stats updates. > diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h > --- a/include/linux/u64_stats_sync.h > +++ b/include/linux/u64_stats_sync.h [ ... ] > @@ -166,19 +166,19 @@ static inline void u64_stats_inc(u64_stats_t *p) > seqcount_init(&__s->seq); \ > } while (0) > > -static inline void __u64_stats_update_begin(struct u64_stats_sync *syncp) > +static inline void notrace __u64_stats_update_begin(struct u64_stats_sync *syncp) > { > preempt_disable_nested(); > write_seqcount_begin(&syncp->seq); > } > > -static inline void __u64_stats_update_end(struct u64_stats_sync *syncp) > +static inline void notrace __u64_stats_update_end(struct u64_stats_sync *syncp) > { > write_seqcount_end(&syncp->seq); > preempt_enable_nested(); > } On 32-bit and PREEMPT_RT, these helpers call write_seqcount_begin() and write_seqcount_end(), which expand to do_write_seqcount_begin() and do_write_seqcount_end() in include/linux/seqlock.h, and then to the do_raw_write_seqcount_*() helpers. Those are plain static inline without notrace. Once the last patch in this series removes notrace from plain inline, can an out-of-line copy of them be traced? If so, could an fentry program attached there and run from bpf_prog_inc_misses_counter() or __update_prog_stats() recurse, which is what this patch is meant to prevent? Should the seqcount helpers be marked notrace as well, or is the commit message claim that the helpers they call are covered too broad? --- AI reviewed your patch. Please fix the bug or email reply why it's not a bug. See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md CI run summary: https://github.com/kernel-patches/bpf/actions/runs/46577721107 --===============8179807642073132361==--