]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: sockmap, synchronize_rcu before free'ing map
authorJohn Fastabend <john.fastabend@gmail.com>
Fri, 19 Jul 2019 17:29:20 +0000 (10:29 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 22 Jul 2019 14:04:17 +0000 (16:04 +0200)
commit944986c5f56f5a3167f49ee64f518b26e2455bee
tree2bd6fddc5a229ea3926fffc1fa4841a16f45ad9d
parent985668879f8747d65d41814ac490e17c9399b030
bpf: sockmap, synchronize_rcu before free'ing map

We need to have a synchronize_rcu before free'ing the sockmap because
any outstanding psock references will have a pointer to the map and
when they use this could trigger a use after free.

Fixes: 38506f4bbc9de ("bpf, sockmap: convert to generic sk_msg interface")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/sock_map.c