netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] tipc: info leak in __tipc_nl_add_udp_addr()
@ 2016-10-13  8:06 Dan Carpenter
  2016-10-13 16:10 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-10-13  8:06 UTC (permalink / raw)
  To: Jon Maloy, Richard Alpe
  Cc: Ying Xue, David S. Miller, netdev, tipc-discussion, linux-kernel,
	kernel-janitors

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));

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] tipc: info leak in __tipc_nl_add_udp_addr()
  2016-10-13  8:06 [patch] tipc: info leak in __tipc_nl_add_udp_addr() Dan Carpenter
@ 2016-10-13 16:10 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-10-13 16:10 UTC (permalink / raw)
  To: dan.carpenter
  Cc: jon.maloy, netdev, kernel-janitors, linux-kernel, tipc-discussion,
	richard.alpe

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.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-13 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13  8:06 [patch] tipc: info leak in __tipc_nl_add_udp_addr() Dan Carpenter
2016-10-13 16:10 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).