[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1476190967-38256-1-git-send-email-vlad@tsyrklevich.net>
Date: Tue, 11 Oct 2016 15:02:47 +0200
From: Vlad Tsyrklevich <vlad@...rklevich.net>
To: netdev@...r.kernel.org
Cc: richardcochran@...il.com, Vlad Tsyrklevich <vlad@...rklevich.net>
Subject: [PATCH] drivers/ptp: Fix kernel memory disclosure
The reserved field precise_offset->rsv is not cleared before being
copied to user space, leaking kernel stack memory. Clear the struct
before it's copied.
Signed-off-by: Vlad Tsyrklevich <vlad@...rklevich.net>
---
drivers/ptp/ptp_chardev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index d637c93..58a97d4 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -193,6 +193,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
if (err)
break;
+ memset(&precise_offset, 0, sizeof(precise_offset));
ts = ktime_to_timespec64(xtstamp.device);
precise_offset.device.sec = ts.tv_sec;
precise_offset.device.nsec = ts.tv_nsec;
--
2.7.0
Powered by blists - more mailing lists