diff options
| author | David S. Miller <[email protected]> | 2011-01-05 23:38:53 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2011-01-05 23:38:53 +0000 |
| commit | 3610cda53f247e176bcbb7a7cca64bc53b12acdb (patch) | |
| tree | d780bc1e405116e75a194b2f4693a6f9bbe9f58f /net/unix/af_unix.c | |
| parent | net_sched: pfifo_head_drop problem (diff) | |
| download | kernel-3610cda53f247e176bcbb7a7cca64bc53b12acdb.tar.gz kernel-3610cda53f247e176bcbb7a7cca64bc53b12acdb.zip | |
af_unix: Avoid socket->sk NULL OOPS in stream connect security hooks.
unix_release() can asynchornously set socket->sk to NULL, and
it does so without holding the unix_state_lock() on "other"
during stream connects.
However, the reverse mapping, sk->sk_socket, is only transitioned
to NULL under the unix_state_lock().
Therefore make the security hooks follow the reverse mapping instead
of the forward mapping.
Reported-by: Jeremy Fitzhardinge <[email protected]>
Reported-by: Linus Torvalds <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
| -rw-r--r-- | net/unix/af_unix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 417d7a6c36cf..dd419d286204 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1157,7 +1157,7 @@ restart: goto restart; } - err = security_unix_stream_connect(sock, other->sk_socket, newsk); + err = security_unix_stream_connect(sk, other, newsk); if (err) { unix_state_unlock(sk); goto out_unlock; |
