]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
Input: uinput - fix undefined behavior in uinput_validate_absinfo()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 14 Jan 2019 21:54:55 +0000 (13:54 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit0f7eaac62ba13a55200f12baf41f7562b8dd5fc3
treea7b7c3dfabfb803667269f59d2c65099b48b8465
parenta8b18c24baf4cd0fb18595020af538e6f15688aa
Input: uinput - fix undefined behavior in uinput_validate_absinfo()

BugLink: https://bugs.launchpad.net/bugs/1837664
commit d77651a227f8920dd7ec179b84e400cce844eeb3 upstream.

An integer overflow may arise in uinput_validate_absinfo() if "max - min"
can't be represented by an "int". We should check for overflow before
trying to use the result.

Reported-by: Kyungtae Kim <kt0755@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/input/misc/uinput.c