Skip to contentSkip to conversation

unix_diag: fix info leak

PATCH In review Mathias Krause 2 participants 2 messages Sep 30, 2013 – Oct 2, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
Probably material for stable as well (v3.3+).

 net/unix/diag.c |    1 +
 1 file changed, 1 insertion(+)
net/unix/diag.c +1 -0
index d591091..86fa0f3 100644
@@ -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);
 
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw

From: Mathias Krause <[email protected]>
Date: Mon, 30 Sep 2013 22:05:40 +0200

Quoted 5 lines

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.

Applied and queued up for -stable, thanks!