]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ppdev: fix PPGETTIME/PPSETTIME ioctls
authorArnd Bergmann <arnd@arndb.de>
Fri, 8 Nov 2019 20:34:30 +0000 (21:34 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:46 +0000 (14:22 -0300)
commit3fa38b36e73a8ffa62754a325ae5c03142cca038
treeb47028abb90041bc646d6ddef0e0c40c1ea95bc2
parent8f1b64b3d75f265a4d861baff1e81c80435541a9
ppdev: fix PPGETTIME/PPSETTIME ioctls

BugLink: https://bugs.launchpad.net/bugs/1857158
commit 998174042da229e2cf5841f574aba4a743e69650 upstream.

Going through the uses of timeval in the user space API,
I noticed two bugs in ppdev that were introduced in the y2038
conversion:

* The range check was accidentally moved from ppsettime to
  ppgettime

* On sparc64, the microseconds are in the other half of the
  64-bit word.

Fix both, and mark the fix for stable backports.

Cc: stable@vger.kernel.org
Fixes: 3b9ab374a1e6 ("ppdev: convert to y2038 safe")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20191108203435.112759-8-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/char/ppdev.c