Commit 5515e9a6 authored by Miroslav Lichvar's avatar Miroslav Lichvar Committed by Linus Torvalds

drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl

The PPS assert/clear offset corrections are set by the PPS_SETPARAMS
ioctl in the pps_ktime structs, which also contain flags.  The flags are
not initialized by applications (using the timepps.h header) and they
are not used by the kernel for anything except returning them back in
the PPS_GETPARAMS ioctl.

Set the flags to zero to make it clear they are unused and avoid leaking
uninitialized data of the PPS_SETPARAMS caller to other applications
that have a read access to the PPS device.

Link: default avatarMiroslav Lichvar <>
Reviewed-by: default avatarThomas Gleixner <>
Acked-by: default avatarRodolfo Giometti <>
Cc: Greg KH <>
Cc: Dan Carpenter <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent f57e515a
......@@ -152,6 +152,14 @@ static long pps_cdev_ioctl(struct file *file,
pps->params.mode |= PPS_CANWAIT;
pps->params.api_version = PPS_API_VERS;
* Clear unused fields of pps_kparams to avoid leaking
* uninitialized data of the PPS_SETPARAMS caller via
pps->params.assert_off_tu.flags = 0;
pps->params.clear_off_tu.flags = 0;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment