[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1483970268-6145-1-git-send-email-vlad@tsyrklevich.net>
Date: Mon, 9 Jan 2017 20:57:48 +0700
From: Vlad Tsyrklevich <vlad@...rklevich.net>
To: acme@...stprotocols.net
Cc: netdev@...r.kernel.org, Vlad Tsyrklevich <vlad@...rklevich.net>
Subject: [PATCH] net/appletalk: Fix kernel memory disclosure
ipddp_route structs contain alignment padding so kernel heap memory
is leaked when they are copied to user space in
ipddp_ioctl(SIOCFINDIPDDPRT). Change kmalloc() to kzalloc() to clear
that memory.
Signed-off-by: Vlad Tsyrklevich <vlad@...rklevich.net>
---
drivers/net/appletalk/ipddp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c
index b8c2933..a306de4 100644
--- a/drivers/net/appletalk/ipddp.c
+++ b/drivers/net/appletalk/ipddp.c
@@ -190,7 +190,7 @@ static netdev_tx_t ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
*/
static int ipddp_create(struct ipddp_route *new_rt)
{
- struct ipddp_route *rt = kmalloc(sizeof(*rt), GFP_KERNEL);
+ struct ipddp_route *rt = kzalloc(sizeof(*rt), GFP_KERNEL);
if (rt == NULL)
return -ENOMEM;
--
2.7.0
Powered by blists - more mailing lists