]> git.baikalelectronics.ru Git - kernel.git/commit
net: mctp: move expiry timer delete to unhash
authorJeremy Kerr <jk@codeconstruct.com.au>
Tue, 24 Jan 2023 02:01:04 +0000 (10:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:48 +0000 (08:34 +0100)
commita2ec00c47d3457eb366a24119930408ecdf6aa97
tree0a8b3aa2654fc3d5ca10c19653529ca37057b563
parent23cf3b60dd809ed84ae58ef490d4b0b6275492a3
net: mctp: move expiry timer delete to unhash

[ Upstream commit 5f41ae6fca9d40ab3cb9b0507931ef7a9b3ea50b ]

Currently, we delete the key expiry timer (in sk->close) before
unhashing the sk. This means that another thread may find the sk through
its presence on the key list, and re-queue the timer.

This change moves the timer deletion to the unhash, after we have made
the key no longer observable, so the timer cannot be re-queued.

Fixes: 62a570acdd11 ("mctp: Implement a timeout for tags")
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>
net/mctp/af_mctp.c