Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH] net: Fix suspicious RCU usage in bpf_sk_reuseport_detach() | Date | Tue, 16 Aug 2022 22:16:46 +0100 |
| |
Hawkins Jiawei <yin31149@gmail.com> wrote:
> +__rcu_dereference_sk_user_data_with_flags_check(const struct sock *sk, > + uintptr_t flags, bool condition)
That doesn't work. RCU_LOCKDEP_WARN() relies on anything passing on a condition down to it to be a macro so that it can vanish the 'condition' argument without causing an undefined symbol for 'lockdep_is_held' if lockdep is disabled:
x86_64-linux-gnu-ld: kernel/bpf/reuseport_array.o: in function `bpf_sk_reuseport_detach': /data/fs/linux-fs/build3/../kernel/bpf/reuseport_array.c:28: undefined reference to `lockdep_is_held'
So either __rcu_dereference_sk_user_data_with_flags_check() has to be a macro, or we need to go with something like the first version of my patch where I don't pass the condition through. Do you have a preference?
David
| |