packet: fix heap info leak in PACKET_DIAG_MCLIST sock_diag interface
authorMathias Krause <minipli@googlemail.com>
Sun, 10 Apr 2016 10:52:28 +0000 (12:52 +0200)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:13:03 +0000 (13:13 +0000)
commitedb5924a11118a4ea61d59f226a272ef06e8ea8c
tree3014fc9c434b1c835867ea3464361d24f3be6a6a
parent6bb1c458d9741df9fe1d2853b43aa1e701a228e0
packet: fix heap info leak in PACKET_DIAG_MCLIST sock_diag interface

commit 309cf37fe2a781279b7675d4bb7173198e532867 upstream.

Because we miss to wipe the remainder of i->addr[] in packet_mc_add(),
pdiag_put_mclist() leaks uninitialized heap bytes via the
PACKET_DIAG_MCLIST netlink attribute.

Fix this by explicitly memset(0)ing the remaining bytes in i->addr[].

Fixes: eea68e2f1a00 ("packet: Report socket mclist info via diag module")
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/packet/af_packet.c