Commit 3b0723c12e825e26aa5fc0c6970108425824b51d
Committed by
David S. Miller
1 parent
c5e1fd8cca
Exists in
master
and in
38 other branches
unix_diag: Fix incoming connections nla length
The NLA_PUT macro should accept the actual attribute length, not the amount of elements in array :( Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
net/unix/diag.c
... | ... | @@ -72,7 +72,8 @@ |
72 | 72 | |
73 | 73 | if (sk->sk_state == TCP_LISTEN) { |
74 | 74 | spin_lock(&sk->sk_receive_queue.lock); |
75 | - buf = UNIX_DIAG_PUT(nlskb, UNIX_DIAG_ICONS, sk->sk_receive_queue.qlen); | |
75 | + buf = UNIX_DIAG_PUT(nlskb, UNIX_DIAG_ICONS, | |
76 | + sk->sk_receive_queue.qlen * sizeof(u32)); | |
76 | 77 | i = 0; |
77 | 78 | skb_queue_walk(&sk->sk_receive_queue, skb) { |
78 | 79 | struct sock *req, *peer; |