]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Input: evdev - fix information leak in evdev_pass_values()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 29 Jul 2026 18:30:45 +0000 (11:30 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 4 Aug 2026 00:51:29 +0000 (17:51 -0700)
commit90f305f2c7a30257c683e13f4bf7c798eea992a0
tree4fd97c5020320efc7c5b4dd18ca3f286772bfc16
parent4c77b45fa23015d41d7401f684bc22ca585b41fe
Input: evdev - fix information leak in evdev_pass_values()

In evdev_pass_values(), the input_event structure is allocated on the
kernel stack and populated field-by-field. However, it is never fully
initialized. On architectures where struct input_event contains explicit
or implicit padding (such as the 32-bit __pad field on SPARC64), these
padding bytes are left uninitialized.

When this event structure is subsequently passed to the client buffer
and later copied to userspace, the uninitialized padding bytes leak
kernel stack memory, potentially exposing sensitive information.

Similar issues exist in __evdev_queue_syn_dropped and __pass_event.

Fix this by explicitly zeroing the entire event structure with memset()
before populating its fields. This ensures all padding bytes are cleared
before the data crosses the security boundary.

Reported-by: sashiko-bot@kernel.org
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/ampGGKo4UMKru6f5@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/evdev.c