Re: [PATCH bpf-next] bpf: Fix state use-after-free on push_stack() err
From: patchwork-bot+netdevbpf
Date: Wed Jun 11 2025 - 19:12:47 EST
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@xxxxxxxxxx>:
On Wed, 11 Jun 2025 23:07:28 +0200 you wrote:
> Without this, `state->speculative` is used after the cleanup cycles in
> push_stack() or push_async_cb() freed `env->cur_state` (i.e., `state`).
> Avoid this by relying on the short-circuit logic to only access `state`
> if the error is recoverable (and make sure it never is after push_*()
> failed).
>
> push_*() callers must always return an error for which
> error_recoverable_with_nospec(err) is false if push_*() returns NULL,
> otherwise we try to recover and access the stale `state`. This is only
> violated by sanitize_ptr_alu(), thus also fix this case to return
> -ENOMEM.
>
> [...]
Here is the summary with links:
- [bpf-next] bpf: Fix state use-after-free on push_stack() err
https://git.kernel.org/bpf/bpf-next/c/1c66f4a3612c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html