# CVE-2021-47338: fbmem: Do not delete the mode that is still in use

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.36% (percentile 22, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-05-21T14:35:47.028Z
- **Modified:** 2026-08-05T08:47:17.872Z

## Who should check

- Anyone running Linux \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 359311b85ebec7c07c3a08ae2f3def946cad33fa; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 087bff9acd2ec6db3f61aceb3224bde90fe0f7f8; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< f193509afc7ff37a46862610c93b896044d5b693; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< d6e76469157d8f240e5dec6f8411aa8d306b1126; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 0af778269a522c988ef0b4188556aba97fb420cc
- Anyone running Linux 5.3

## Description

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

fbmem: Do not delete the mode that is still in use

The execution of fb\_delete\_videomode() is not based on the result of the
previous fbcon\_mode\_deleted(). As a result, the mode is directly deleted,
regardless of whether it is still in use, which may cause UAF.

==================================================================
BUG: KASAN: use-after-free in fb\_mode\_is\_equal+0x36e/0x5e0 \\
drivers/video/fbdev/core/modedb.c:924
Read of size 4 at addr ffff88807e0ddb1c by task syz-executor.0/18962

CPU: 2 PID: 18962 Comm: syz-executor.0 Not tainted 5.10.45-rc1+ \#3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ...
Call Trace:
 \_\_dump\_stack lib/dump\_stack.c:77 \[inline\]
 dump\_stack+0x137/0x1be lib/dump\_stack.c:118
 print\_address\_description+0x6c/0x640 mm/kasan/report.c:385
 \_\_kasan\_report mm/kasan/report.c:545 \[inline\]
 kasan\_report+0x13d/0x1e0 mm/kasan/report.c:562
 fb\_mode\_is\_equal+0x36e/0x5e0 drivers/video/fbdev/core/modedb.c:924
 fbcon\_mode\_deleted+0x16a/0x220 drivers/video/fbdev/core/fbcon.c:2746
 fb\_set\_var+0x1e1/0xdb0 drivers/video/fbdev/core/fbmem.c:975
 do\_fb\_ioctl+0x4d9/0x6e0 drivers/video/fbdev/core/fbmem.c:1108
 vfs\_ioctl fs/ioctl.c:48 \[inline\]
 \_\_do\_sys\_ioctl fs/ioctl.c:753 \[inline\]
 \_\_se\_sys\_ioctl+0xfb/0x170 fs/ioctl.c:739
 do\_syscall\_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry\_SYSCALL\_64\_after\_hwframe+0x44/0xa9

Freed by task 18960:
 kasan\_save\_stack mm/kasan/common.c:48 \[inline\]
 kasan\_set\_track+0x3d/0x70 mm/kasan/common.c:56
 kasan\_set\_free\_info+0x17/0x30 mm/kasan/generic.c:355
 \_\_kasan\_slab\_free+0x108/0x140 mm/kasan/common.c:422
 slab\_free\_hook mm/slub.c:1541 \[inline\]
 slab\_free\_freelist\_hook+0xd6/0x1a0 mm/slub.c:1574
 slab\_free mm/slub.c:3139 \[inline\]
 kfree+0xca/0x3d0 mm/slub.c:4121
 fb\_delete\_videomode+0x56a/0x820 drivers/video/fbdev/core/modedb.c:1104
 fb\_set\_var+0x1f3/0xdb0 drivers/video/fbdev/core/fbmem.c:978
 do\_fb\_ioctl+0x4d9/0x6e0 drivers/video/fbdev/core/fbmem.c:1108
 vfs\_ioctl fs/ioctl.c:48 \[inline\]
 \_\_do\_sys\_ioctl fs/ioctl.c:753 \[inline\]
 \_\_se\_sys\_ioctl+0xfb/0x170 fs/ioctl.c:739
 do\_syscall\_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry\_SYSCALL\_64\_after\_hwframe+0x44/0xa9

## Affected and fixed versions

- Linux: \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 359311b85ebec7c07c3a08ae2f3def946cad33fa; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 087bff9acd2ec6db3f61aceb3224bde90fe0f7f8; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< f193509afc7ff37a46862610c93b896044d5b693; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< d6e76469157d8f240e5dec6f8411aa8d306b1126; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 0af778269a522c988ef0b4188556aba97fb420cc (cvelist)
- Linux: 5.3 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2021-47338.md
Affected: Linux >= 13ff178ccd6d3b8074c542a911300b79c4eec255, < 359311b85ebec7c07c3a08ae2f3def946cad33fa; >= 13ff178ccd6d3b8074c542a911300b79c4eec255, < 087bff9acd2ec6db3f61aceb3224bde90fe0f7f8; >= 13ff178ccd6d3b8074c542a911300b79c4eec255, < f193509afc7ff37a46862610c93b896044d5b693; >= 13ff178ccd6d3b8074c542a…
Fixed in: Linux 359311b85ebec7c07c3a08ae2f3def946cad33fa, Linux 087bff9acd2ec6db3f61aceb3224bde90fe0f7f8, Linux 0af778269a522c988ef0b4188556aba97fb420cc

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

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 359311b85ebec7c07c3a08ae2f3def946cad33fa; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 087bff9acd2ec6db3f61aceb3224bde90fe0f7f8; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< f193509afc7ff37a46862610c93b896044d5b693; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< d6e76469157d8f240e5dec6f8411aa8d306b1126; \>= 13ff178ccd6d3b8074c542a911300b79c4eec255, \< 0af778269a522c988ef0b4188556aba97fb420cc; Linux 5.3.

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

Yes. Fixed in Linux 359311b85ebec7c07c3a08ae2f3def946cad33fa, Linux 087bff9acd2ec6db3f61aceb3224bde90fe0f7f8, Linux 0af778269a522c988ef0b4188556aba97fb420cc. Upgrade Linux to 0af778269a522c988ef0b4188556aba97fb420cc or later.

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

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/359311b85ebec7c07c3a08ae2f3def946cad33fa>
- patch: <https://git.kernel.org/stable/c/087bff9acd2ec6db3f61aceb3224bde90fe0f7f8>
- patch: <https://git.kernel.org/stable/c/f193509afc7ff37a46862610c93b896044d5b693>
- patch: <https://git.kernel.org/stable/c/d6e76469157d8f240e5dec6f8411aa8d306b1126>
- patch: <https://git.kernel.org/stable/c/0af778269a522c988ef0b4188556aba97fb420cc>

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

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