summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat-kone.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2021-05-20 19:56:15 -0700
committerKees Cook <keescook@chromium.org>2021-09-25 08:20:48 -0700
commit69dae0fe1073944065fff0f7fe24cde6e150ee9d (patch)
treee8a039a46b42c3e71befea74608a7197a805ac71 /drivers/hid/hid-roccat-kone.h
parent5e423a0c2db6d02811e67704d1bcb0b412b98406 (diff)
downloadlinux-stable-69dae0fe1073944065fff0f7fe24cde6e150ee9d.tar.gz
linux-stable-69dae0fe1073944065fff0f7fe24cde6e150ee9d.tar.bz2
linux-stable-69dae0fe1073944065fff0f7fe24cde6e150ee9d.zip
HID: roccat: Use struct_group() to zero kone_mouse_event
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct kone_mouse_event that should be initialized to zero. Cc: Stefan Achatz <erazor_de@users.sourceforge.net> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: linux-input@vger.kernel.org Acked-by: Jiri Kosina <jikos@kernel.org> Link: https://lore.kernel.org/lkml/nycvar.YFH.7.76.2108201810560.15313@cbobk.fhfr.pm Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/hid/hid-roccat-kone.h')
-rw-r--r--drivers/hid/hid-roccat-kone.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/hid/hid-roccat-kone.h b/drivers/hid/hid-roccat-kone.h
index 4a1a9cb76b08..65c800e3addc 100644
--- a/drivers/hid/hid-roccat-kone.h
+++ b/drivers/hid/hid-roccat-kone.h
@@ -152,11 +152,13 @@ struct kone_mouse_event {
uint16_t x;
uint16_t y;
uint8_t wheel; /* up = 1, down = -1 */
- uint8_t tilt; /* right = 1, left = -1 */
- uint8_t unknown;
- uint8_t event;
- uint8_t value; /* press = 0, release = 1 */
- uint8_t macro_key; /* 0 to 8 */
+ struct_group(wipe,
+ uint8_t tilt; /* right = 1, left = -1 */
+ uint8_t unknown;
+ uint8_t event;
+ uint8_t value; /* press = 0, release = 1 */
+ uint8_t macro_key; /* 0 to 8 */
+ );
} __attribute__ ((__packed__));
enum kone_mouse_events {