Commit 11425384 authored by Kangjie Lu's avatar Kangjie Lu Committed by Ben Hutchings

net: fix infoleak in rtnetlink

commit 5f8e4474 upstream.

The stack object “map” has a total size of 32 bytes. Its last 4
bytes are padding generated by compiler. These padding bytes are
not initialized and sent out via “nla_put”.
Signed-off-by: default avatarKangjie Lu <kjlu@gatech.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context, indentation]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 3ec6a22d
...@@ -920,14 +920,16 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, ...@@ -920,14 +920,16 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
NLA_PUT_STRING(skb, IFLA_IFALIAS, dev->ifalias); NLA_PUT_STRING(skb, IFLA_IFALIAS, dev->ifalias);
if (1) { if (1) {
struct rtnl_link_ifmap map = { struct rtnl_link_ifmap map;
.mem_start = dev->mem_start,
.mem_end = dev->mem_end, memset(&map, 0, sizeof(map));
.base_addr = dev->base_addr, map.mem_start = dev->mem_start;
.irq = dev->irq, map.mem_end = dev->mem_end;
.dma = dev->dma, map.base_addr = dev->base_addr;
.port = dev->if_port, map.irq = dev->irq;
}; map.dma = dev->dma;
map.port = dev->if_port;
NLA_PUT(skb, IFLA_MAP, sizeof(map), &map); NLA_PUT(skb, IFLA_MAP, sizeof(map), &map);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment