Re: [PATCH bpf-next 0/3] Don't invoke KPTR_REF destructor on NULL xchg

From: patchwork-bot+netdevbpf
Date: Sat Mar 25 2023 - 20:12:21 EST


Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@xxxxxxxxxx>:

On Sat, 25 Mar 2023 16:31:41 -0500 you wrote:
> When a map value is being freed, we loop over all of the fields of the
> corresponding BPF object and issue the appropriate cleanup calls
> corresponding to the field's type. If the field is a referenced kptr, we
> atomically xchg the value out of the map, and invoke the kptr's
> destructor on whatever was there before.
>
> Currently, we always invoke the destructor (or bpf_obj_drop() for a
> local kptr) on any kptr, including if no value was xchg'd out of the
> map. This means that any function serving as the kptr's KF_RELEASE
> destructor must always treat the argument as possibly NULL, and we
> invoke unnecessary (and seemingly unsafe) cleanup logic for the local
> kptr path as well.
>
> [...]

Here is the summary with links:
- [bpf-next,1/3] bpf: Only invoke kptr dtor following non-NULL xchg
https://git.kernel.org/bpf/bpf-next/c/1431d0b584a6
- [bpf-next,2/3] bpf: Remove now-unnecessary NULL checks for KF_RELEASE kfuncs
https://git.kernel.org/bpf/bpf-next/c/fb2211a57c11
- [bpf-next,3/3] bpf: Treat KF_RELEASE kfuncs as KF_TRUSTED_ARGS
https://git.kernel.org/bpf/bpf-next/c/6c831c468412

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