OSDN Git Service

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)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:08:03 +0000 (10:08 +0200)
commit38245d0340ea732057f69b957de609cec56cd061
tree18cc7ac0999d587025d17e6e8ae24667887d18bd
parentef11357046512918ab876aa0f837b0a6de65a3c6
HID: u2fzero: ignore incomplete packets without data

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: 42337b9d4d958("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>
drivers/hid/hid-u2fzero.c