# CVE-2021-46951: tpm: efi: Use local variable for calculating final log size

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.24% (percentile 9, 2026-11-28)
- **CWE:** CWE-191
- **Published:** 2024-02-27T18:40:34.757Z
- **Modified:** 2026-06-17T04:15:57.507Z

## Who should check

- Anyone running Linux \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 2f12258b5224cfaa808c54fd29345f3c1cbfca76; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 60a01ecc9f68067e4314a0b55148e39e5d58a51b; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 3818b753277f5ca0c170bf5b98e0a5a225542fcb; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< ac07c557ca12ec9276c0375517bac7ae5be4e50c; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 48cff270b037022e37835d93361646205ca25101
- Anyone running Linux 5.3

## Description

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

tpm: efi: Use local variable for calculating final log size

When tpm\_read\_log\_efi is called multiple times, which happens when
one loads and unloads a TPM2 driver multiple times, then the global
variable efi\_tpm\_final\_log\_size will at some point become a negative
number due to the subtraction of final\_events\_preboot\_size occurring
each time. Use a local variable to avoid this integer underflow.

The following issue is now resolved:

Mar  8 15:35:12 hibinst kernel: Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
Mar  8 15:35:12 hibinst kernel: Workqueue: tpm-vtpm vtpm\_proxy\_work \[tpm\_vtpm\_proxy\]
Mar  8 15:35:12 hibinst kernel: RIP: 0010:\_\_memcpy+0x12/0x20
Mar  8 15:35:12 hibinst kernel: Code: 00 b8 01 00 00 00 85 d2 74 0a c7 05 44 7b ef 00 0f 00 00 00 c3 cc cc cc 66 66 90 66 90 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 \<f3\> 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 f3 a4
Mar  8 15:35:12 hibinst kernel: RSP: 0018:ffff9ac4c0fcfde0 EFLAGS: 00010206
Mar  8 15:35:12 hibinst kernel: RAX: ffff88f878cefed5 RBX: ffff88f878ce9000 RCX: 1ffffffffffffe0f
Mar  8 15:35:12 hibinst kernel: RDX: 0000000000000003 RSI: ffff9ac4c003bff9 RDI: ffff88f878cf0e4d
Mar  8 15:35:12 hibinst kernel: RBP: ffff9ac4c003b000 R08: 0000000000001000 R09: 000000007e9d6073
Mar  8 15:35:12 hibinst kernel: R10: ffff9ac4c003b000 R11: ffff88f879ad3500 R12: 0000000000000ed5
Mar  8 15:35:12 hibinst kernel: R13: ffff88f878ce9760 R14: 0000000000000002 R15: ffff88f77de7f018
Mar  8 15:35:12 hibinst kernel: FS:  0000000000000000(0000) GS:ffff88f87bd00000(0000) knlGS:0000000000000000
Mar  8 15:35:12 hibinst kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Mar  8 15:35:12 hibinst kernel: CR2: ffff9ac4c003c000 CR3: 00000001785a6004 CR4: 0000000000060ee0
Mar  8 15:35:12 hibinst kernel: Call Trace:
Mar  8 15:35:12 hibinst kernel: tpm\_read\_log\_efi+0x152/0x1a7
Mar  8 15:35:12 hibinst kernel: tpm\_bios\_log\_setup+0xc8/0x1c0
Mar  8 15:35:12 hibinst kernel: tpm\_chip\_register+0x8f/0x260
Mar  8 15:35:12 hibinst kernel: vtpm\_proxy\_work+0x16/0x60 \[tpm\_vtpm\_proxy\]
Mar  8 15:35:12 hibinst kernel: process\_one\_work+0x1b4/0x370
Mar  8 15:35:12 hibinst kernel: worker\_thread+0x53/0x3e0
Mar  8 15:35:12 hibinst kernel: ? process\_one\_work+0x370/0x370

## Affected and fixed versions

- Linux: \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 2f12258b5224cfaa808c54fd29345f3c1cbfca76; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 60a01ecc9f68067e4314a0b55148e39e5d58a51b; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 3818b753277f5ca0c170bf5b98e0a5a225542fcb; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< ac07c557ca12ec9276c0375517bac7ae5be4e50c; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 48cff270b037022e37835d93361646205ca25101 (cvelist)
- Linux: 5.3 (cvelist)

## Mitigation

- Upgrade Linux to 48cff270b037022e37835d93361646205ca25101 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-46951. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-46951.md
Affected: Linux >= 166a2809d65b282272c474835ec22c882a39ca1b, < 2f12258b5224cfaa808c54fd29345f3c1cbfca76; >= 166a2809d65b282272c474835ec22c882a39ca1b, < 60a01ecc9f68067e4314a0b55148e39e5d58a51b; >= 166a2809d65b282272c474835ec22c882a39ca1b, < 3818b753277f5ca0c170bf5b98e0a5a225542fcb; >= 166a2809d65b282272c4748…
Fixed in: Linux 2f12258b5224cfaa808c54fd29345f3c1cbfca76, Linux 60a01ecc9f68067e4314a0b55148e39e5d58a51b, Linux 3818b753277f5ca0c170bf5b98e0a5a225542fcb, Linux 48cff270b037022e37835d93361646205ca25101

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-46951 being exploited?

There is no confirmed exploitation: CVE-2021-46951 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.24% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2021-46951?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-46951?

Linux \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 2f12258b5224cfaa808c54fd29345f3c1cbfca76; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 60a01ecc9f68067e4314a0b55148e39e5d58a51b; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 3818b753277f5ca0c170bf5b98e0a5a225542fcb; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< ac07c557ca12ec9276c0375517bac7ae5be4e50c; \>= 166a2809d65b282272c474835ec22c882a39ca1b, \< 48cff270b037022e37835d93361646205ca25101; Linux 5.3.

### Is there a fix for CVE-2021-46951?

Yes. Fixed in Linux 2f12258b5224cfaa808c54fd29345f3c1cbfca76, Linux 60a01ecc9f68067e4314a0b55148e39e5d58a51b, Linux 3818b753277f5ca0c170bf5b98e0a5a225542fcb, Linux 48cff270b037022e37835d93361646205ca25101. Upgrade Linux to 48cff270b037022e37835d93361646205ca25101 or later.

### How do I check if I'm affected by CVE-2021-46951?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/2f12258b5224cfaa808c54fd29345f3c1cbfca76>
- patch: <https://git.kernel.org/stable/c/60a01ecc9f68067e4314a0b55148e39e5d58a51b>
- patch: <https://git.kernel.org/stable/c/3818b753277f5ca0c170bf5b98e0a5a225542fcb>
- patch: <https://git.kernel.org/stable/c/ac07c557ca12ec9276c0375517bac7ae5be4e50c>
- patch: <https://git.kernel.org/stable/c/48cff270b037022e37835d93361646205ca25101>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-46951>

HTML: <https://flawdb.com/CVE-2021-46951> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-46951>
