Find a file
Andrej Shadura b7abf78b7a HID: u2fzero: clarify error check and length calculations
The previous commit fixed handling of incomplete packets but broke error
handling: offsetof returns an unsigned value (size_t), but when compared
against the signed return value, the return value is interpreted as if
it were unsigned, so negative return values are never less than the
offset.

To make the code easier to read, calculate the minimal packet length
once and separately, and assign it to a signed int variable to eliminate
unsigned math and the need for type casts. It then becomes immediately
obvious how the actual data length is calculated and why the return
value cannot be less than the minimal length.

Fixes: 22d65765f2 ("HID: u2fzero: ignore incomplete packets without data")
Fixes: 42337b9d4d ("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>
2021-10-27 10:17:08 +02:00
arch This is the bulk of pin control changes for the v5.15 kernel cycle, 2021-09-02 14:22:56 -07:00
block for-5.15-tag 2021-08-31 09:41:22 -07:00
certs certs: Add support for using elliptic curve keys for signing modules 2021-08-23 19:55:42 +03:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2021-08-30 12:57:10 -07:00
Documentation This is the bulk of pin control changes for the v5.15 kernel cycle, 2021-09-02 14:22:56 -07:00
drivers HID: u2fzero: clarify error check and length calculations 2021-10-27 10:17:08 +02:00
fs linux-kselftest-kunit-5.15-rc1 2021-09-02 12:32:12 -07:00
include This is the bulk of pin control changes for the v5.15 kernel cycle, 2021-09-02 14:22:56 -07:00
init printk changes for 5.15 2021-09-01 18:41:13 -07:00
ipc Merge branch 'akpm' (patches from Andrew) 2021-07-02 12:08:10 -07:00
kernel LKMM updates: 2021-09-02 13:00:15 -07:00
lib parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm memblock: robustness and debug improvements 2021-09-02 12:26:31 -07:00
net TTY / Serial patches for 5.15-rc1 2021-09-01 09:51:16 -07:00
samples VFIO update for v5.15-rc1 2021-09-02 13:41:33 -07:00
scripts VFIO update for v5.15-rc1 2021-09-02 13:41:33 -07:00
security integrity-v5.15 2021-09-02 12:51:41 -07:00
sound parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
tools LKMM updates: 2021-09-02 13:00:15 -07:00
usr .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
virt KVM: Do not leak memory for duplicate debugfs directories 2021-08-04 06:02:03 -04:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap mailmap: update email address of Matthias Fuchs and Thomas Körper 2021-08-19 09:39:44 +02:00
COPYING
CREDITS MAINTAINERS: move Murali Karicheri to credits 2021-04-29 15:47:30 -07:00
Kbuild
Kconfig
MAINTAINERS This is the bulk of pin control changes for the v5.15 kernel cycle, 2021-09-02 14:22:56 -07:00
Makefile parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.