HID: magicmouse: sanity check report size in raw_event() callback
authorJiri Kosina <jkosina@suse.cz>
Wed, 27 Aug 2014 07:12:24 +0000 (09:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:54:08 +0000 (14:54 -0700)
commit11677bd1cc851c9dda154095f62d93b2c34afc9c
tree83bd3228d2485a5842eec806feecff1bc7d1ed3f
parent8ee6be5563a5bdb9a5df5f88f8bbbab8930fe6da
HID: magicmouse: sanity check report size in raw_event() callback

commit c54def7bd64d7c0b6993336abcffb8444795bf38 upstream.

The report passed to us from transport driver could potentially be
arbitrarily large, therefore we better sanity-check it so that
magicmouse_emit_touch() gets only valid values of raw_id.

Reported-by: Steven Vittitoe <scvitti@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-magicmouse.c