bpf, devmap: Pass lockdep expression to RCU lists
authorAmol Grover <frextrite@gmail.com>
Thu, 23 Jan 2020 12:04:38 +0000 (17:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:35:29 +0000 (04:35 -0800)
commitab48c14a444b9198e91435526b68bfdf2613c2d0
tree3e285b8771f9113975c63caa0188d928139f88b0
parent77bb53cb094828a31cd3c5b402899810f63073c1
bpf, devmap: Pass lockdep expression to RCU lists

commit 485ec2ea9cf556e9c120e07961b7b459d776a115 upstream.

head is traversed using hlist_for_each_entry_rcu outside an RCU
read-side critical section but under the protection of dtab->index_lock.

Hence, add corresponding lockdep expression to silence false-positive
lockdep warnings, and harden RCU lists.

Fixes: 6f9d451ab1a3 ("xdp: Add devmap_hash map type for looking up devices by hashed index")
Signed-off-by: Amol Grover <frextrite@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20200123120437.26506-1-frextrite@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/devmap.c