diff options
author | Kees Cook <keescook@chromium.org> | 2013-09-11 15:56:50 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-09-13 09:11:21 -0400 |
commit | 331415ff16a12147d57d5c953f3a961b7ede348b (patch) | |
tree | 79a497ffd03b720215e567c9c9862090fc76d0fa /include/linux | |
parent | b04c99e3b845892d754ee8052d6324c39c4040de (diff) |
HID: provide a helper for validating hid reports
Many drivers need to validate the characteristics of their HID report
during initialization to avoid misusing the reports. This adds a common
helper to perform validation of the report exisitng, the field existing,
and the expected number of values within the field.
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/hid.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index ee1ffc5e19c9..31b9d299ef6c 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -756,6 +756,10 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags); | |||
756 | struct hid_device *hid_allocate_device(void); | 756 | struct hid_device *hid_allocate_device(void); |
757 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); | 757 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); |
758 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | 758 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
759 | struct hid_report *hid_validate_values(struct hid_device *hid, | ||
760 | unsigned int type, unsigned int id, | ||
761 | unsigned int field_index, | ||
762 | unsigned int report_counts); | ||
759 | int hid_open_report(struct hid_device *device); | 763 | int hid_open_report(struct hid_device *device); |
760 | int hid_check_keys_pressed(struct hid_device *hid); | 764 | int hid_check_keys_pressed(struct hid_device *hid); |
761 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | 765 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); |