diff options
author | Kangjie Lu <kangjielu@gmail.com> | 2016-05-03 16:46:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-04 16:19:42 -0400 |
commit | 5f8e44741f9f216e33736ea4ec65ca9ac03036e6 (patch) | |
tree | 3c078305d96895088203e3d38b6851472897a4e6 /net | |
parent | b8670c09f37bdf2847cc44f36511a53afc6161fd (diff) |
net: 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”.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/rtnetlink.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a75f7e94b445..65763c29f845 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1180,14 +1180,16 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb, | |||
1180 | 1180 | ||
1181 | static int rtnl_fill_link_ifmap(struct sk_buff *skb, struct net_device *dev) | 1181 | static int rtnl_fill_link_ifmap(struct sk_buff *skb, struct net_device *dev) |
1182 | { | 1182 | { |
1183 | struct rtnl_link_ifmap map = { | 1183 | struct rtnl_link_ifmap map; |
1184 | .mem_start = dev->mem_start, | 1184 | |
1185 | .mem_end = dev->mem_end, | 1185 | memset(&map, 0, sizeof(map)); |
1186 | .base_addr = dev->base_addr, | 1186 | map.mem_start = dev->mem_start; |
1187 | .irq = dev->irq, | 1187 | map.mem_end = dev->mem_end; |
1188 | .dma = dev->dma, | 1188 | map.base_addr = dev->base_addr; |
1189 | .port = dev->if_port, | 1189 | map.irq = dev->irq; |
1190 | }; | 1190 | map.dma = dev->dma; |
1191 | map.port = dev->if_port; | ||
1192 | |||
1191 | if (nla_put(skb, IFLA_MAP, sizeof(map), &map)) | 1193 | if (nla_put(skb, IFLA_MAP, sizeof(map), &map)) |
1192 | return -EMSGSIZE; | 1194 | return -EMSGSIZE; |
1193 | 1195 | ||