Re: [PATCH bpf] bpf: Skip unsettled links in link iterator

From: patchwork-bot+netdevbpf

Date: Thu Sep 17 2026 - 18:11:35 EST


Hello:

This patch was applied to bpf/bpf.git (master)
by Andrii Nakryiko <andrii@xxxxxxxxxx>:

On Tue, 15 Sep 2026 01:02:07 +0800 you wrote:
> bpf_link_prime() inserts a link into link_idr before anon_inode_getfile()
> succeeds and before bpf_link_settle() publishes the ID in link->id.
> bpf_link_by_id() treats such an ID-zero link as unsettled, but the link
> iterator takes a reference without this check.
>
> If anon_inode_getfile() then fails, the creator removes the ID and frees
> its still-private link directly. The iterator is left with a dangling
> reference and its next bpf_link_put() accesses freed memory.
>
> [...]

Here is the summary with links:
- [bpf] bpf: Skip unsettled links in link iterator
https://git.kernel.org/bpf/bpf/c/50e80e2bb5e2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html