Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500078 > unrolled thread

[patch] tipc: info leak in __tipc_nl_add_udp_addr()

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-10-13 10:10 +0200
Last post2016-10-13 18:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch] tipc: info leak in __tipc_nl_add_udp_addr() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-13 10:10 +0200
    Re: [patch] tipc: info leak in __tipc_nl_add_udp_addr() David Miller <davem@davemloft.net> - 2016-10-13 18:20 +0200

#1500078 — [patch] tipc: info leak in __tipc_nl_add_udp_addr()

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-10-13 10:10 +0200
Subject[patch] tipc: info leak in __tipc_nl_add_udp_addr()
Message-ID<srJfr-Vf-7@gated-at.bofh.it>
We should clear out the padding and unused struct members so that we
don't expose stack information to userspace.

Fixes: fdb3accc2c15 ('tipc: add the ability to get UDP options via netlink')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This goes into the net tree.

diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index d80cd3f..78cab9c 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -407,6 +407,7 @@ static int __tipc_nl_add_udp_addr(struct sk_buff *skb,
 	if (ntohs(addr->proto) == ETH_P_IP) {
 		struct sockaddr_in ip4;
 
+		memset(&ip4, 0, sizeof(ip4));
 		ip4.sin_family = AF_INET;
 		ip4.sin_port = addr->port;
 		ip4.sin_addr.s_addr = addr->ipv4.s_addr;
@@ -417,6 +418,7 @@ static int __tipc_nl_add_udp_addr(struct sk_buff *skb,
 	} else if (ntohs(addr->proto) == ETH_P_IPV6) {
 		struct sockaddr_in6 ip6;
 
+		memset(&ip6, 0, sizeof(ip6));
 		ip6.sin6_family = AF_INET6;
 		ip6.sin6_port  = addr->port;
 		memcpy(&ip6.sin6_addr, &addr->ipv6, sizeof(struct in6_addr));

[toc] | [next] | [standalone]


#1500410

FromDavid Miller <davem@davemloft.net>
Date2016-10-13 18:20 +0200
Message-ID<srQTE-5MC-7@gated-at.bofh.it>
In reply to#1500078
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 13 Oct 2016 11:06:06 +0300

> We should clear out the padding and unused struct members so that we
> don't expose stack information to userspace.
> 
> Fixes: fdb3accc2c15 ('tipc: add the ability to get UDP options via netlink')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web