aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/diag.c
diff options
context:
space:
mode:
authorMathias Krause <[email protected]>2013-09-30 20:05:40 +0000
committerDavid S. Miller <[email protected]>2013-10-02 20:08:24 +0000
commit6865d1e834be84ddd5808d93d5035b492346c64a (patch)
treea970a98630b927756028377cb1d28b83535982be /net/unix/diag.c
parentMerge branch 'connector' (diff)
downloadkernel-6865d1e834be84ddd5808d93d5035b492346c64a.tar.gz
kernel-6865d1e834be84ddd5808d93d5035b492346c64a.zip
unix_diag: fix info leak
When filling the netlink message we miss to wipe the pad field, therefore leak one byte of heap memory to userland. Fix this by setting pad to 0. Signed-off-by: Mathias Krause <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/unix/diag.c')
-rw-r--r--net/unix/diag.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/unix/diag.c b/net/unix/diag.c
index d591091603bf..86fa0f3b2caf 100644
--- a/net/unix/diag.c
+++ b/net/unix/diag.c
@@ -124,6 +124,7 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_r
rep->udiag_family = AF_UNIX;
rep->udiag_type = sk->sk_type;
rep->udiag_state = sk->sk_state;
+ rep->pad = 0;
rep->udiag_ino = sk_ino;
sock_diag_save_cookie(sk, rep->udiag_cookie);