]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:36:28 +0000 (09:36 +0200)
commit3f306336cdee80f830c46a768c08daf90a31e972
tree62574ddd0e1c0ad68fe146679e2b05b560286c4e
parentf671ac7a5317edddcc8d4593bae3ea1dde5334ed
HID: core: Fix size as type u32

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>
drivers/hid/hid-core.c
include/linux/hid.h