summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2013-03-09 05:52:21 +0000
committerWilly Tarreau <w@1wt.eu>2013-06-10 11:43:34 +0200
commit0e03cad4fb451922fb5371ddec1919b491ad2b08 (patch)
tree5c1c4310bd857e8adf4abb3c89e623f9928bef45
parent480cabccafcfd68837bd4423d93e1cc2b1f170d5 (diff)
dcbnl: fix various netlink info leaks
commit 29cd8ae0e1a39e239a3a7b67da1986add1199fc0 upstream. The dcb netlink interface leaks stack memory in various places: * perm_addr[] buffer is only filled at max with 12 of the 32 bytes but copied completely, * no in-kernel driver fills all fields of an IEEE 802.1Qaz subcommand, so we're leaking up to 58 bytes for ieee_ets structs, up to 136 bytes for ieee_pfc structs, etc., * the same is true for CEE -- no in-kernel driver fills the whole struct, Prevent all of the above stack info leaks by properly initializing the buffers/structures involved. Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net> [bwh: Backported to 2.6.32: no support for IEEE or CEE commands, so only deal with perm_addr] Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--net/dcb/dcbnl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index ac1205df6c86..813fe4b137e5 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -307,6 +307,7 @@ static int dcbnl_getperm_hwaddr(struct net_device *netdev, struct nlattr **tb,
dcb->dcb_family = AF_UNSPEC;
dcb->cmd = DCB_CMD_GPERM_HWADDR;
+ memset(perm_addr, 0, sizeof(perm_addr));
netdev->dcbnl_ops->getpermhwaddr(netdev, perm_addr);
ret = nla_put(dcbnl_skb, DCB_ATTR_PERM_HWADDR, sizeof(perm_addr),