]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.8.4/rtnl-fix-info-leak-on-rtm_getlink-request-for-vf-devices.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.8.4 / rtnl-fix-info-leak-on-rtm_getlink-request-for-vf-devices.patch
CommitLineData
8002656c
GKH
1From 322aa953dd5565d1029a18d5bda0bd25a0dbb4bb Mon Sep 17 00:00:00 2001
2From: Mathias Krause <minipli@googlemail.com>
3Date: Sat, 9 Mar 2013 05:52:20 +0000
4Subject: rtnl: fix info leak on RTM_GETLINK request for VF devices
5
6
7From: Mathias Krause <minipli@googlemail.com>
8
9[ Upstream commit 84d73cd3fb142bf1298a8c13fd4ca50fd2432372 ]
10
11Initialize the mac address buffer with 0 as the driver specific function
12will probably not fill the whole buffer. In fact, all in-kernel drivers
13fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible
14bytes. Therefore we currently leak 26 bytes of stack memory to userland
15via the netlink interface.
16
17Signed-off-by: Mathias Krause <minipli@googlemail.com>
18Signed-off-by: David S. Miller <davem@davemloft.net>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 net/core/rtnetlink.c | 1 +
22 1 file changed, 1 insertion(+)
23
24--- a/net/core/rtnetlink.c
25+++ b/net/core/rtnetlink.c
26@@ -976,6 +976,7 @@ static int rtnl_fill_ifinfo(struct sk_bu
27 * report anything.
28 */
29 ivi.spoofchk = -1;
30+ memset(ivi.mac, 0, sizeof(ivi.mac));
31 if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi))
32 break;
33 vf_mac.vf =