summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2013-10-01 00:05:40 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-04 16:23:41 +0400
commitf4358dfd80518a11e4386a15750ad2601d0cf539 (patch)
tree2fe354771769c8af96f70ff73e0c4af833714869
parentdf290b8ea8c8b3305a3b3a4eb36ec1d2d79570de (diff)
downloadlinux-f4358dfd80518a11e4386a15750ad2601d0cf539.tar.xz
unix_diag: fix info leak
[ Upstream commit 6865d1e834be84ddd5808d93d5035b492346c64a ] 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 <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 f0486ae9ebe6..2656840cf203 100644
--- a/net/unix/diag.c
+++ b/net/unix/diag.c
@@ -134,6 +134,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);