4.8-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Vlad Tsyrklevich <v...@tsyrklevich.net>


[ Upstream commit 02a9079c66341836c4914c33c06a73245060df2e ]

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 <v...@tsyrklevich.net>
Acked-by: Richard Cochran <richardcoch...@gmail.com>
Signed-off-by: David S. Miller <da...@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/ptp/ptp_chardev.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -193,6 +193,7 @@ long ptp_ioctl(struct posix_clock *pc, u
                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;


Reply via email to