# CVE-2021-46997: arm64: entry: always set GIC\_PRIO\_PSR\_I\_SET during entry

> 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.25% (percentile 10, 2026-11-26)
- **Published:** 2024-02-28T08:13:21.043Z
- **Modified:** 2026-06-17T04:16:07.470Z

## Who should check

- Anyone running Linux \>= 23529049c68423820487304f244144e0d576e85a, \< 51524fa8b5f7b879ba569227738375d283b79382; \>= 23529049c68423820487304f244144e0d576e85a, \< e67a83f078005461b59b4c776e6b5addd11725fa; \>= 23529049c68423820487304f244144e0d576e85a, \< d8d52005f57bbb4a4ec02f647e2555d327135c68; \>= 23529049c68423820487304f244144e0d576e85a, \< 4d6a38da8e79e94cbd1344aa90876f0f805db705
- Anyone running Linux 5.10

## Description

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

arm64: entry: always set GIC\_PRIO\_PSR\_I\_SET during entry

Zenghui reports that booting a kernel with "irqchip.gicv3\_pseudo\_nmi=1"
on the command line hits a warning during kernel entry, due to the way
we manipulate the PMR.

Early in the entry sequence, we call lockdep\_hardirqs\_off() to inform
lockdep that interrupts have been masked (as the HW sets DAIF wqhen
entering an exception). Architecturally PMR\_EL1 is not affected by
exception entry, and we don't set GIC\_PRIO\_PSR\_I\_SET in the PMR early in
the exception entry sequence, so early in exception entry the PMR can
indicate that interrupts are unmasked even though they are masked by
DAIF.

If DEBUG\_LOCKDEP is selected, lockdep\_hardirqs\_off() will check that
interrupts are masked, before we set GIC\_PRIO\_PSR\_I\_SET in any of the
exception entry paths, and hence lockdep\_hardirqs\_off() will WARN() that
something is amiss.

We can avoid this by consistently setting GIC\_PRIO\_PSR\_I\_SET during
exception entry so that kernel code sees a consistent environment. We
must also update local\_daif\_inherit() to undo this, as currently only
touches DAIF. For other paths, local\_daif\_restore() will update both
DAIF and the PMR. With this done, we can remove the existing special
cases which set this later in the entry code.

We always use (GIC\_PRIO\_IRQON \| GIC\_PRIO\_PSR\_I\_SET) for consistency with
local\_daif\_save(), as this will warn if it ever encounters
(GIC\_PRIO\_IRQOFF \| GIC\_PRIO\_PSR\_I\_SET), and never sets this itself. This
matches the gic\_prio\_kentry\_setup that we have to retain for
ret\_to\_user.

The original splat from Zenghui's report was:

\| DEBUG\_LOCKS\_WARN\_ON(!irqs\_disabled())
\| WARNING: CPU: 3 PID: 125 at kernel/locking/lockdep.c:4258 lockdep\_hardirqs\_off+0xd4/0xe8
\| Modules linked in:
\| CPU: 3 PID: 125 Comm: modprobe Tainted: G        W         5.12.0-rc8+ \#463
\| Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
\| pstate: 604003c5 (nZCv DAIF +PAN -UAO -TCO BTYPE=--)
\| pc : lockdep\_hardirqs\_off+0xd4/0xe8
\| lr : lockdep\_hardirqs\_off+0xd4/0xe8
\| sp : ffff80002a39bad0
\| pmr\_save: 000000e0
\| x29: ffff80002a39bad0 x28: ffff0000de214bc0
\| x27: ffff0000de1c0400 x26: 000000000049b328
\| x25: 0000000000406f30 x24: ffff0000de1c00a0
\| x23: 0000000020400005 x22: ffff8000105f747c
\| x21: 0000000096000044 x20: 0000000000498ef9
\| x19: ffff80002a39bc88 x18: ffffffffffffffff
\| x17: 0000000000000000 x16: ffff800011c61eb0
\| x15: ffff800011700a88 x14: 0720072007200720
\| x13: 0720072007200720 x12: 0720072007200720
\| x11: 0720072007200720 x10: 0720072007200720
\| x9 : ffff80002a39bad0 x8 : ffff80002a39bad0
\| x7 : ffff8000119f0800 x6 : c0000000ffff7fff
\| x5 : ffff8000119f07a8 x4 : 0000000000000001
\| x3 : 9bcdab23f2432800 x2 : ffff800011730538
\| x1 : 9bcdab23f2432800 x0 : 0000000000000000
\| Call trace:
\|  lockdep\_hardirqs\_off+0xd4/0xe8
\|  enter\_from\_kernel\_mode.isra.5+0x7c/0xa8
\|  el1\_abort+0x24/0x100
\|  el1\_sync\_handler+0x80/0xd0
\|  el1\_sync+0x6c/0x100
\|  \_\_arch\_clear\_user+0xc/0x90
\|  load\_elf\_binary+0x9fc/0x1450
\|  bprm\_execve+0x404/0x880
\|  kernel\_execve+0x180/0x188
\|  call\_usermodehelper\_exec\_async+0xdc/0x158
\|  ret\_from\_fork+0x10/0x18

## Affected and fixed versions

- Linux: \>= 23529049c68423820487304f244144e0d576e85a, \< 51524fa8b5f7b879ba569227738375d283b79382; \>= 23529049c68423820487304f244144e0d576e85a, \< e67a83f078005461b59b4c776e6b5addd11725fa; \>= 23529049c68423820487304f244144e0d576e85a, \< d8d52005f57bbb4a4ec02f647e2555d327135c68; \>= 23529049c68423820487304f244144e0d576e85a, \< 4d6a38da8e79e94cbd1344aa90876f0f805db705 (cvelist)
- Linux: 5.10 (cvelist)

## Mitigation

- Upgrade Linux to 4d6a38da8e79e94cbd1344aa90876f0f805db705 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-46997. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-46997.md
Affected: Linux >= 23529049c68423820487304f244144e0d576e85a, < 51524fa8b5f7b879ba569227738375d283b79382; >= 23529049c68423820487304f244144e0d576e85a, < e67a83f078005461b59b4c776e6b5addd11725fa; >= 23529049c68423820487304f244144e0d576e85a, < d8d52005f57bbb4a4ec02f647e2555d327135c68; >= 23529049c68423820487304…
Fixed in: Linux 51524fa8b5f7b879ba569227738375d283b79382, Linux 4d6a38da8e79e94cbd1344aa90876f0f805db705

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-46997 being exploited?

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

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

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

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

Linux \>= 23529049c68423820487304f244144e0d576e85a, \< 51524fa8b5f7b879ba569227738375d283b79382; \>= 23529049c68423820487304f244144e0d576e85a, \< e67a83f078005461b59b4c776e6b5addd11725fa; \>= 23529049c68423820487304f244144e0d576e85a, \< d8d52005f57bbb4a4ec02f647e2555d327135c68; \>= 23529049c68423820487304f244144e0d576e85a, \< 4d6a38da8e79e94cbd1344aa90876f0f805db705; Linux 5.10.

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

Yes. Fixed in Linux 51524fa8b5f7b879ba569227738375d283b79382, Linux 4d6a38da8e79e94cbd1344aa90876f0f805db705. Upgrade Linux to 4d6a38da8e79e94cbd1344aa90876f0f805db705 or later.

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

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/51524fa8b5f7b879ba569227738375d283b79382>
- patch: <https://git.kernel.org/stable/c/e67a83f078005461b59b4c776e6b5addd11725fa>
- patch: <https://git.kernel.org/stable/c/d8d52005f57bbb4a4ec02f647e2555d327135c68>
- patch: <https://git.kernel.org/stable/c/4d6a38da8e79e94cbd1344aa90876f0f805db705>

## 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-46997>

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