HID: picolcd: sanity check report size in raw_event() callback
authorJiri Kosina <jkosina@suse.cz>
Wed, 27 Aug 2014 07:13:15 +0000 (09:13 +0200)
committerZefan Li <lizefan@huawei.com>
Thu, 25 Sep 2014 03:49:15 +0000 (11:49 +0800)
commite78c127e8ee714142edb1d76956ebf40750ab218
tree2dfdfd058a332c4ee71f8232d6ce7578b21e8578
parente115f02bda5dc98fc31cec1fe6160bcee887789c
HID: picolcd: sanity check report size in raw_event() callback

commit 844817e47eef14141cf59b8d5ac08dd11c0a9189 upstream.

The report passed to us from transport driver could potentially be
arbitrarily large, therefore we better sanity-check it so that raw_data
that we hold in picolcd_pending structure are always kept within proper
bounds.

Reported-by: Steven Vittitoe <scvitti@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[lizf: Backported to 3.4: adjust filename]
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/hid/hid-picolcd.c