CVE Vulnerabilities

CVE-2021-46932

Improper Initialization

Published: Feb 27, 2024 | Modified: Apr 10, 2024
CVSS 3.x
5.5
MEDIUM
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
Ubuntu

In the Linux kernel, the following vulnerability has been resolved:

Input: appletouch - initialize work before device registration

Syzbot has reported warning in __flush_work(). This warning is caused by work->func == NULL, which means missing work initialization.

This may happen, since input_dev->close() calls cancel_work_sync(&dev->work), but dev->work initalization happens after input_register_device() call.

So this patch moves dev->work initialization before registering input device

Weakness

The product does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.

Affected Software

Name Vendor Start Version End Version
Linux_kernel Linux 2.6.23 (including) 4.4.298 (excluding)
Linux_kernel Linux 4.5.0 (including) 4.9.296 (excluding)
Linux_kernel Linux 4.10.0 (including) 4.14.261 (excluding)
Linux_kernel Linux 4.15.0 (including) 4.19.224 (excluding)
Linux_kernel Linux 4.20.0 (including) 5.4.170 (excluding)
Linux_kernel Linux 5.5.0 (including) 5.10.90 (excluding)
Linux_kernel Linux 5.11.0 (including) 5.15.13 (excluding)

Potential Mitigations

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
  • For example, in Java, if the programmer does not explicitly initialize a variable, then the code could produce a compile-time error (if the variable is local) or automatically initialize the variable to the default value for the variable’s type. In Perl, if explicit initialization is not performed, then a default value of undef is assigned, which is interpreted as 0, false, or an equivalent value depending on the context in which the variable is accessed.

References