diff options
| author | Yonghong Song <[email protected]> | 2018-08-14 18:01:12 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2018-08-16 19:55:32 +0000 |
| commit | 965931e3a803a506482616f89239eff6901c17b8 (patch) | |
| tree | 22c2ccac1861446a76c794422aa6a57a7c360b69 /net/ipv4/tcp_ulp.c | |
| parent | samples/bpf: all XDP samples should unload xdp/bpf prog on SIGTERM (diff) | |
| download | kernel-965931e3a803a506482616f89239eff6901c17b8.tar.gz kernel-965931e3a803a506482616f89239eff6901c17b8.zip | |
bpf: fix a rcu usage warning in bpf_prog_array_copy_core()
Commit 394e40a29788 ("bpf: extend bpf_prog_array to store pointers
to the cgroup storage") refactored the bpf_prog_array_copy_core()
to accommodate new structure bpf_prog_array_item which contains
bpf_prog array itself.
In the old code, we had
perf_event_query_prog_array():
mutex_lock(...)
bpf_prog_array_copy_call():
prog = rcu_dereference_check(array, 1)->progs
bpf_prog_array_copy_core(prog, ...)
mutex_unlock(...)
With the above commit, we had
perf_event_query_prog_array():
mutex_lock(...)
bpf_prog_array_copy_call():
bpf_prog_array_copy_core(array, ...):
item = rcu_dereference(array)->items;
...
mutex_unlock(...)
The new code will trigger a lockdep rcu checking warning.
The fix is to change rcu_dereference() to rcu_dereference_check()
to prevent such a warning.
Reported-by: [email protected]
Fixes: 394e40a29788 ("bpf: extend bpf_prog_array to store pointers to the cgroup storage")
Cc: Roman Gushchin <[email protected]>
Signed-off-by: Yonghong Song <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Acked-by: Roman Gushchin <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_ulp.c')
0 files changed, 0 insertions, 0 deletions
