]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2019 06:29:57 +0000 (08:29 +0200)
commit47032e94979e01100de1ba846c40d5adf2a30ab4
treea470da12dabb0115150cb4e9d6b39b70d6534bb7
parent2a574254d6f59b4e5f64277712c2480e74ef1bc6
bpf: sockmap, synchronize_rcu before free'ing map

[ Upstream commit 2bb90e5cc90e1d09f631aeab041a9cf913a5bbe5 ]

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: 604326b41a6fb ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/sock_map.c