diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-26 14:41:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-26 14:41:55 -0500 |
commit | e09e9d189bc2d31dc365a3d846a09086317350b6 (patch) | |
tree | f0ef78c8b75cde8210ee5832d8b4c82c466c46f1 /net | |
parent | 3b0723c12e825e26aa5fc0c6970108425824b51d (diff) | |
download | op-kernel-dev-e09e9d189bc2d31dc365a3d846a09086317350b6.zip op-kernel-dev-e09e9d189bc2d31dc365a3d846a09086317350b6.tar.gz |
unix: If we happen to find peer NULL when diag dumping, write zero.
Otherwise we leave uninitialized kernel memory in there.
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/unix/diag.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/unix/diag.c b/net/unix/diag.c index 39e44c9..c5bdbcb 100644 --- a/net/unix/diag.c +++ b/net/unix/diag.c @@ -86,8 +86,7 @@ static int sk_diag_dump_icons(struct sock *sk, struct sk_buff *nlskb) */ unix_state_lock_nested(req); peer = unix_sk(req)->peer; - if (peer) - buf[i++] = sock_i_ino(peer); + buf[i++] = (peer ? sock_i_ino(peer) : 0); unix_state_unlock(req); } spin_unlock(&sk->sk_receive_queue.lock); |