+ pps-clear-offset-flags-in-pps_setparams-ioctl.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl
has been added to the -mm tree.  Its filename is
     pps-clear-offset-flags-in-pps_setparams-ioctl.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/pps-clear-offset-flags-in-pps_setparams-ioctl.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/pps-clear-offset-flags-in-pps_setparams-ioctl.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
Subject: 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: http://lkml.kernel.org/r/20190702092251.24303-1-mlichvar@xxxxxxxxxx
Signed-off-by: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Acked-by: Rodolfo Giometti <giometti@xxxxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Cc: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/pps/pps.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/pps/pps.c~pps-clear-offset-flags-in-pps_setparams-ioctl
+++ a/drivers/pps/pps.c
@@ -152,6 +152,14 @@ static long pps_cdev_ioctl(struct 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_GETPARAMS
+		 */
+		pps->params.assert_off_tu.flags = 0;
+		pps->params.clear_off_tu.flags = 0;
+
 		spin_unlock_irq(&pps->lock);
 
 		break;
_

Patches currently in -mm which might be from mlichvar@xxxxxxxxxx are

pps-clear-offset-flags-in-pps_setparams-ioctl.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux