]> git.baikalelectronics.ru Git - kernel.git/commit
HID: u2fzero: ignore incomplete packets without data
authorAndrej Shadura <andrew.shadura@collabora.co.uk>
Thu, 16 Sep 2021 16:33:11 +0000 (17:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 13:42:37 +0000 (15:42 +0200)
commit21840d3f82710b841f6c684bf67e810c734c20ec
treee4d74536834bb37dbef4327887220e187b305497
parenta35f8dbfa0dfe835c934623e30cada5164767226
HID: u2fzero: ignore incomplete packets without data

commit 22d65765f211cc83186fd8b87521159f354c0da9 upstream.

Since the actual_length calculation is performed unsigned, packets
shorter than 7 bytes (e.g. packets without data or otherwise truncated)
or non-received packets ("zero" bytes) can cause buffer overflow.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=214437
Fixes: 9a55fd8b33495("HID: add driver for U2F Zero built-in LED and RNG")
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-u2fzero.c