Skip to contentSkip to conversation

char: synclink_gt: fix information leak to userland

PATCH In review Vasiliy Kulikov 2 participants 2 messages Oct 17, 2010 – Oct 18, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 7/8 char: synclink_gt: fix information leak to userland

Structures tmp_params and new_line are copied to userland with some padding fields unitialized. It leads to leaking of stack memory.

---
Compile tested.

 drivers/char/synclink_gt.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/char/synclink_gt.c +3 -0
index 1746d91..c3c2cf8 100644
@@ -1132,6 +1132,7 @@ static long get_params32(struct slgt_info *info, struct MGSL_PARAMS32 __user *us
 	struct MGSL_PARAMS32 tmp_params;
 
 	DBGINFO(("%s get_params32\n", info->device_name));
+	memset(&tmp_params, 0, sizeof(tmp_params));
 	tmp_params.mode            = (compat_ulong_t)info->params.mode;
 	tmp_params.loopback        = info->params.loopback;
 	tmp_params.flags           = info->params.flags;
@@ -1617,6 +1618,8 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	if (cmd != SIOCWANDEV)
 		return hdlc_ioctl(dev, ifr, cmd);
 
+	memset(&new_line, 0, sizeof(new_line));
+
 	switch(ifr->ifr_settings.type) {
 	case IF_GET_IFACE: /* return current sync_serial_settings */
 
Signature · 1 line
1.7.0.4
Acked-by on v1 7/8
#1 lore raw
Quoted 4 lines · Vasiliy Kulikov

Structures tmp_params and new_line are copied to userland with some padding fields unitialized. It leads to leaking of stack memory.

Signature · 8 lines
Paul Fulghum
MicroGate Systems, Ltd.
=Customer Driven, by Design=
(800)444-1982
(512)345-7791 (Direct)
(512)343-9046 (Fax)
Central Time Zone (GMT -6h)
www.microgate.com