aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkangjie <kangjielu@gmail.com>2016-05-03 21:49:23 -0400
committerAndreas Blaesius <skate4life@gmx.de>2016-10-13 19:39:26 +0200
commitb2190c76c30a7b5eadb036df94a5b989c3369c1a (patch)
treef2a272e7e55082ce3b87c3648a4a018151c88bb8
parentf0483fd257785bd7b3c340d6067bf62458274348 (diff)
downloadkernel_samsung_espresso10-b2190c76c30a7b5eadb036df94a5b989c3369c1a.zip
kernel_samsung_espresso10-b2190c76c30a7b5eadb036df94a5b989c3369c1a.tar.gz
kernel_samsung_espresso10-b2190c76c30a7b5eadb036df94a5b989c3369c1a.tar.bz2
fix infoleak in rtnetlink
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” Bug: 28620102 Change-Id: I13da380c6fe8abca49e3cf9f05293c02b44d2e5e Signed-off-by: kangjie <kangjielu@gmail.com>
-rw-r--r--net/core/rtnetlink.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 4698e7c..f37b870 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -915,14 +915,14 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
NLA_PUT_STRING(skb, IFLA_IFALIAS, dev->ifalias);
if (1) {
- struct rtnl_link_ifmap map = {
- .mem_start = dev->mem_start,
- .mem_end = dev->mem_end,
- .base_addr = dev->base_addr,
- .irq = dev->irq,
- .dma = dev->dma,
- .port = dev->if_port,
- };
+ struct rtnl_link_ifmap map;
+ memset(&map, 0, sizeof(map));
+ map.mem_start = dev->mem_start;
+ map.mem_end = dev->mem_end;
+ map.base_addr = dev->base_addr;
+ map.irq = dev->irq;
+ map.dma = dev->dma;
+ map.port = dev->if_port;
NLA_PUT(skb, IFLA_MAP, sizeof(map), &map);
}