drivers/char/hpet.c: fix information leak to userland
Structure info is copied to userland with some padding fields unitialized. It leads to leaking of stack memory. [akpm@linux-foundation.org: remove now-unneeded zeroing of info->hi_ireqfreq] Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
aaaddfe0b3
commit
dae512edc6
|
@ -596,11 +596,10 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg,
|
||||||
break;
|
break;
|
||||||
case HPET_INFO:
|
case HPET_INFO:
|
||||||
{
|
{
|
||||||
|
memset(info, 0, sizeof(*info));
|
||||||
if (devp->hd_ireqfreq)
|
if (devp->hd_ireqfreq)
|
||||||
info->hi_ireqfreq =
|
info->hi_ireqfreq =
|
||||||
hpet_time_div(hpetp, devp->hd_ireqfreq);
|
hpet_time_div(hpetp, devp->hd_ireqfreq);
|
||||||
else
|
|
||||||
info->hi_ireqfreq = 0;
|
|
||||||
info->hi_flags =
|
info->hi_flags =
|
||||||
readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK;
|
readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK;
|
||||||
info->hi_hpet = hpetp->hp_which;
|
info->hi_hpet = hpetp->hp_which;
|
||||||
|
|
Loading…
Reference in New Issue