summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2013-03-25 07:18:33 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-05 21:16:53 +0400
commit92a33e58656098d3dbf538b3c1c86e6fcfbccb6c (patch)
treecd20745ee0b5864b1d4b6da618b3d291d551b8cd /drivers
parent0cbf0cbd285ef39202743ecfd62b4fe2dcdc81fd (diff)
downloadlinux-92a33e58656098d3dbf538b3c1c86e6fcfbccb6c.tar.xz
unix: fix a race condition in unix_release()
[ Upstream commit ded34e0fe8fe8c2d595bfa30626654e4b87621e0 ] As reported by Jan, and others over the past few years, there is a race condition caused by unix_release setting the sock->sk pointer to NULL before properly marking the socket as dead/orphaned. This can cause a problem with the LSM hook security_unix_may_send() if there is another socket attempting to write to this partially released socket in between when sock->sk is set to NULL and it is marked as dead/orphaned. This patch fixes this by only setting sock->sk to NULL after the socket has been marked as dead; I also take the opportunity to make unix_release_sock() a void function as it only ever returned 0/success. Dave, I think this one should go on the -stable pile. Special thanks to Jan for coming up with a reproducer for this problem. Reported-by: Jan Stancek <jan.stancek@gmail.com> Signed-off-by: Paul Moore <pmoore@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions