mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
HID: fix HIDIOCGRDESC memory access in hidraw
Fix bogus copying of data into userspace when HIDIOCGRDESC is issued. HID-transport layer makes sure that dev->hid->rdesc is not larger than HID_MAX_DESCRIPTOR_SIZE. Noticed-by: Al Viro <viro@ftp.linux.org.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
23fd50450a
commit
57d292bd7e
3 changed files with 24 additions and 14 deletions
|
@ -15,9 +15,11 @@
|
|||
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <linux/hid.h>
|
||||
|
||||
struct hidraw_report_descriptor {
|
||||
__u32 size;
|
||||
__u8 *value;
|
||||
__u8 value[HID_MAX_DESCRIPTOR_SIZE];
|
||||
};
|
||||
|
||||
struct hidraw_devinfo {
|
||||
|
@ -40,8 +42,6 @@ struct hidraw_devinfo {
|
|||
/* kernel-only API declarations */
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/hid.h>
|
||||
|
||||
struct hidraw {
|
||||
unsigned int minor;
|
||||
int exist;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue