]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
HID: core: Fix size as type u32
authorAaron Ma <aaron.ma@canonical.com>
Mon, 8 Jan 2018 02:41:41 +0000 (10:41 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:48:37 +0000 (11:48 -0400)
commit8a7bae2fda855a021910bc51fd8fbe8b105c730c
treed89cabb62ded42ebdbb5d04b06c8a6d0e41c9c78
parentefa93189113605cb50289f4c9efc1e68596b05f3
HID: core: Fix size as type u32

BugLink: http://bugs.launchpad.net/bugs/1773233
commit 6de0b13cc0b4ba10e98a9263d7a83b940720b77a upstream.

When size is negative, calling memset will make segment fault.
Declare the size as type u32 to keep memset safe.

size in struct hid_report is unsigned, fix return type of
hid_report_len to u32.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/hid-core.c
include/linux/hid.h