linux/net/mctp
Jeremy Kerr a8f2ee1071 net: mctp: mark socks as dead on unhash, prevent re-add
[ Upstream commit b98e1a04e2 ]

Once a socket has been unhashed, we want to prevent it from being
re-used in a sk_key entry as part of a routing operation.

This change marks the sk as SOCK_DEAD on unhash, which prevents addition
into the net's key list.

We need to do this during the key add path, rather than key lookup, as
we release the net keys_lock between those operations.

Fixes: 4a992bbd36 ("mctp: Implement message fragmentation & reassembly")
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-02-01 08:34:48 +01:00
..
test Networking changes for 5.19. 2022-05-25 12:22:58 -07:00
af_mctp.c net: mctp: mark socks as dead on unhash, prevent re-add 2023-02-01 08:34:48 +01:00
device.c mctp: Remove device type check at unregister 2022-12-31 13:32:56 +01:00
Kconfig mctp: Add flow extension to skb 2021-10-29 13:23:51 +01:00
Makefile mctp: Add test utils 2021-10-03 14:35:41 +01:00
neigh.c mctp: replace mctp_address_ok with more fine-grained helpers 2022-02-18 21:24:28 -08:00
route.c net: mctp: mark socks as dead on unhash, prevent re-add 2023-02-01 08:34:48 +01:00