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=1796040447; b=1MOpC4tMFXRk9d0vzBne+0EK8mUS+rLcSY0G/osU3EiYKx8PvOh3aIUzd+RovkmK+lEj ksQWXIrdhAbrihPO2DXlXngpMQ9yVTx/7dRlpl1HTEh7mp7UkPzG2oFpl1ttZxxN/owBZ CGcNcPACklEtGOlP3CQ4Jug/W7BqdfhDHUh5rFwvmOrGvXGWqcocYGjW3xoIX8qA/Vm6Q A1adrIv4RwmxIafWQPSNk/3w6RKFtULnOTt6+iBD/WVx89Xny1hBCmWeslECrTDWRPXke M8J/Od9bX5Umo3pgX2OD60ciZfP4EltQtew8VzNZhHZ9NdoMnr6fvTMkHfqaLglvW7Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796040447; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=RdMUOh70dkkxA4OjJn5fscumwXLHPvniMWdiuCVHbxo=; b=mo+g/JMQOarWVLTfxpd0IeV468WsefBzbz9nSctzc2RwE0JESeVj0ZHK0FJ5T6hifh9Q BtrfduaBlc6N78HpYi8bY8bzRhCBNVO5tP8UaOkar/NSDijDTECdiu9Oq6C8AsPOvMS2Y 4Iv3cB9LvrUcjots9eZmmeiTlPsUzsbGBpUSeSrHVDp5y8kSqM3QY3UF2WKLY7crOmiTc Jyl3DdeEcFQJK+RiWcKaO4F18e/T6uUlWjOmrM1TSeTmz3p9LAOnISth73MMzjiVS9nQs +w9UHYefFLbZMIXM6Bi6CNSasXvfi2ANLEHOnneVkwt/XvV08D6SVZlAqzliwNvbAzw== 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=Qvudp5GU; 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 4E6E0606A31C; Mon, 30 Nov 2026 12:07:27 +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=Qvudp5GU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DC611F00897; Mon, 30 Nov 2026 12:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796040446; bh=RdMUOh70dkkxA4OjJn5fscumwXLHPvniMWdiuCVHbxo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Qvudp5GUAV6uw7p5jEjiHio1O7ST1UAYExZx7HvxYMuIocjZEfOtW6d2+oT4iF797 tvkstAA0151xf06LBhsXbFNPEQ3su7us0BGUmwUDZUOMlfG0EX06n6W7JYAPtkWxwL ePQazgw7EVq8hBEsU9Uwm4QJFAC4MJtE06b+DiCh0MXEtIarUa0j2aPt2gdfj5fw8S RWh3aRInbzgX3yJZzGToninNZr94/a+3XxG+1LFwSUjX5+xEIaeWLV49+QZVyyYgBJ 1QO1Z+jCDVn89WjTDGm/uGU+ISdDBnN/KwJuG+RsXu5EGFtYLPPJkS1/MefYClX1aX oEjcuDBVOyp+Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH bpf-next v4 1/6] bpf: Avoid per-CPU private stack in preemptible tracing progs Reply-To: sashiko-reviews@lists.linux.dev To: "Mike Bazov" , bpf@vger.kernel.org Cc: linux-trace-kernel@vger.kernel.org In-Reply-To: <20261130-bpf-preempt-v2-r2-v4-1-bd28389dfd64@sentinelone.com> References: <20261130-bpf-preempt-v2-r2-v4-0-bd28389dfd64@sentinelone.com> <20261130-bpf-preempt-v2-r2-v4-1-bd28389dfd64@sentinelone.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 12:07:26 +0000 X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] bpf: missing Fixes trailer for commit a76ab5731e32 in commit message -- commit 1135e0f53c94db70e9dfbc351c5cf570c2c631bd Author: Mike Bazov > bpf: Avoid per-CPU private stack in preemptible tracing progs > > A per-CPU private stack is only safe if a program never runs in two > tasks at once on one CPU. Commit a76ab5731e32 ("bpf: Find eligible > subprogs for private stack support") gave one to tracing, raw_tp and > tracepoint programs, but they run preemptibly, and two tasks can > already be inside one of them on a CPU: > > - Two raw_tp dispatchers that tail-call the same handler each pass > their own per-CPU recursion check, so both tasks run the handler. > - A tracepoint program attached to a syscall tracepoint and to a > regular tracepoint can be entered by a second task through the > regular one, which only checks bpf_prog_active. > > The second task then overwrites the preempted task's stack. Neither > case can be seen when the program is loaded, so never give these > program types a private stack. The next patches make such overlap the > normal case. > > check_recursion() told tracing programs apart by whether they can get a > private stack. Make it check the program type instead, so that > recursive subprograms stay rejected in these program types. > > Move the selftests that relied on these program types having a private > stack to kprobe.multi and perf_event programs. > > Trade-offs: > > - These programs use the kernel stack again. > - A program with two 2000-byte frames no longer loads: "combined stack > size of 2 calls is 4000. Too large". > - Unwinding on a private stack is no longer tested at run time: raw_tp > was the only such program type that BPF_PROG_TEST_RUN runs. > > Signed-off-by: Mike Bazov [Severity: Low] Since this fixes per-CPU private stack corruption in preemptible tracing, raw_tp and tracepoint programs, should it include a Fixes tag? Fixes: a76ab5731e32 ("bpf: Find eligible subprogs for private stack suppo= rt") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130-bpf-preemp= t-v2-r2-v4-0-bd28389dfd64@sentinelone.com?part=3D1