Skip to content
Commit a8f2ee10 authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Greg Kroah-Hartman
Browse files

net: mctp: mark socks as dead on unhash, prevent re-add

[ Upstream commit b98e1a04 ]

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: 4a992bbd

 ("mctp: Implement message fragmentation & reassembly")
Signed-off-by: default avatarJeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6a524787
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment