]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: devmap: fix wrong interface selection in notifier_call
authorTaehee Yoo <ap420073@gmail.com>
Wed, 24 Oct 2018 11:15:17 +0000 (20:15 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 25 Oct 2018 22:32:21 +0000 (00:32 +0200)
commit7f677e719f3270c0c880fb28f6dcaf2391e78fb8
tree1b4368acf0867c3ace26466ee8b44e20755acf34
parent33e558d6d855dbf33cf57c93405f575c573f2f2a
bpf: devmap: fix wrong interface selection in notifier_call

The dev_map_notification() removes interface in devmap if
unregistering interface's ifindex is same.
But only checking ifindex is not enough because other netns can have
same ifindex. so that wrong interface selection could occurred.
Hence netdev pointer comparison code is added.

v2: compare netdev pointer instead of using net_eq() (Daniel Borkmann)
v1: Initial patch

Fixes: 570d00d0f568 ("net: add notifier hooks for devmap bpf map")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/devmap.c