Kuniyuki Iwashima 5a08a32e62 ping: Fix potentail NULL deref for /proc/net/icmp.
[ Upstream commit ab5fb73ffa01072b4d8031cc05801fa1cb653bee ]

After commit dbca1596bbb0 ("ping: convert to RCU lookups, get rid
of rwlock"), we use RCU for ping sockets, but we should use spinlock
for /proc/net/icmp to avoid a potential NULL deref mentioned in
the previous patch.

Let's go back to using spinlock there.

Note we can convert ping sockets to use hlist instead of hlist_nulls
because we do not use SLAB_TYPESAFE_BY_RCU for ping sockets.

Fixes: dbca1596bbb0 ("ping: convert to RCU lookups, get rid of rwlock")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-13 16:55:24 +02:00
..
2023-02-14 19:11:48 +01:00
2021-05-17 15:29:35 -07:00
2023-04-13 16:55:21 +02:00
2021-10-13 09:41:37 -07:00
2021-05-17 15:29:35 -07:00
2023-04-13 16:55:23 +02:00
2022-09-20 10:21:49 -07:00
2021-05-17 15:29:35 -07:00