mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
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@tsyrklevich.net> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b8a4ddb2e8
commit
02a9079c66
1 changed files with 1 additions and 0 deletions
|
@ -193,6 +193,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
memset(&precise_offset, 0, sizeof(precise_offset));
|
||||||
ts = ktime_to_timespec64(xtstamp.device);
|
ts = ktime_to_timespec64(xtstamp.device);
|
||||||
precise_offset.device.sec = ts.tv_sec;
|
precise_offset.device.sec = ts.tv_sec;
|
||||||
precise_offset.device.nsec = ts.tv_nsec;
|
precise_offset.device.nsec = ts.tv_nsec;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue