Message ID | 20230325213144.486885-1-void@manifault.com (mailing list archive) |
---|---|
Headers | show |
Series | Don't invoke KPTR_REF destructor on NULL xchg | expand |
Hello: This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <ast@kernel.org>: 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!