Message ID | 20230824063417.201925-1-yonghong.song@linux.dev (mailing list archive) |
---|---|
State | Accepted |
Commit | 393dc4bd92de3711012d791a93072c8cc94c4c57 |
Delegated to: | BPF |
Headers | show |
Series | [bpf-next,v2,1/2] bpf: Remove a WARN_ON_ONCE warning related to local kptr | expand |
Hello: This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <ast@kernel.org>: On Wed, 23 Aug 2023 23:34:17 -0700 you wrote: > Currently, in function bpf_obj_free_fields(), for local kptr, > a warning will be issued if the struct does not contain any > special fields. But actually the kernel seems totally okay > with a local kptr without any special fields. Permitting > no special fields also aligns with future percpu kptr which > also allows no special fields. > > [...] Here is the summary with links: - [bpf-next,v2,1/2] bpf: Remove a WARN_ON_ONCE warning related to local kptr https://git.kernel.org/bpf/bpf-next/c/393dc4bd92de - [bpf-next,v2,2/2] selftests/bpf: Add a local kptr test with no special fields https://git.kernel.org/bpf/bpf-next/c/001fedacc907 You are awesome, thank you!
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 10666d17b9e3..ebeb0695305a 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -657,7 +657,6 @@ void bpf_obj_free_fields(const struct btf_record *rec, void *obj) if (!btf_is_kernel(field->kptr.btf)) { pointee_struct_meta = btf_find_struct_meta(field->kptr.btf, field->kptr.btf_id); - WARN_ON_ONCE(!pointee_struct_meta); migrate_disable(); __bpf_obj_drop_impl(xchgd_field, pointee_struct_meta ? pointee_struct_meta->record :