CVE-2021-47634: ubi: Fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl
Noroxi assessment
Priority: Monitor (action score 31/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 0.29% (FIRST EPSS).
- Someone with local access to the system can trigger it. A low-privileged account is enough. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: Linux Linux 1a3f1cf87054833242fcd0218de0481cf855f888, 3.11, 3.13.
Low priority for now. Upgrade to Linux Linux 1a3f1cf87054833242fcd0218de0481cf855f888, 3.11, 3.13 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
In the Linux kernel, the following vulnerability has been resolved: ubi: Fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl Hulk Robot reported a KASAN report about use-after-free: ================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0x13d/0x160 Read of size 8 at addr ffff888035e37d98 by task ubiattach/1385 [...] Call Trace: klist_dec_and_del+0xa7/0x4a0 klist_put+0xc7/0x1a0 device_del+0x4d4/0xed0 cdev_device_del+0x1a/0x80 ubi_attach_mtd_dev+0x2951/0x34b0 [ubi] ctrl_cdev_ioctl+0x286/0x2f0 [ubi] Allocated by task 1414: device_add+0x60a/0x18b0 cdev_device_add+0x103/0x170 ubi_create_volume+0x1118/0x1a10 [ubi] ubi_cdev_ioctl+0xb7f/0x1ba0 [ubi] Freed by task 1385: cdev_device_del+0x1a/0x80 ubi_remove_volume+0x438/0x6c0 [ubi] ubi_cdev_ioctl+0xbf4/0x1ba0 [ubi] [...] ================================================================== The lock held by ctrl_cdev_ioctl is ubi_devices_mutex, but the lock held by ubi_cdev_ioctl is ubi->device_mutex. Therefore, the two locks can be concurrent. ctrl_cdev_ioctl contains two operations: ubi_attach and ubi_detach. ubi_detach is bug-free because it uses reference counting to prevent concurrency. However, uif_init and uif_close in ubi_attach may race with ubi_cdev_ioctl. uif_init will race with ubi_cdev_ioctl as in the following stack. cpu1 cpu2 cpu3 _______________________|________________________|______________________ ctrl_cdev_ioctl ubi_attach_mtd_dev uif_init ubi_cdev_ioctl ubi_create_volume cdev_device_add ubi_add_volume // sysfs exist kill_volumes ubi_cdev_ioctl ubi_remove_volume cdev_device_del // first free ubi_free_volume cdev_del // double free cdev_device_del And uif_close will race with ubi_cdev_ioctl as in the following stack. cpu1 cpu2 cpu3 _______________________|________________________|______________________ ctrl_cdev_ioctl ubi_attach_mtd_dev uif_init ubi_cdev_ioctl ubi_create_volume cdev_device_add ubi_debugfs_init_dev //error goto out_uif; uif_close kill_volumes ubi_cdev_ioctl ubi_remove_volume cdev_device_del // first free ubi_free_volume // double free The cause of this problem is that commit 714fb87e8bc0 make device "available" before it becomes accessible via sysfs. Therefore, we roll back the modification. We will fix the race condition between ubi device creation and udev by removing ubi_get_device in vol_attribute_show and dev_attribute_show.This avoids accessing uninitialized ubi_devices[ubi_num]. ubi_get_device is used to prevent devices from being deleted during sysfs execution. However, now kernfs ensures that devices will not be deleted before all reference counting are released. The key process is shown in the following stack. device_del device_remove_attrs device_remove_groups sysfs_remove_groups sysfs_remove_group remove_files kernfs_remove_by_name kernfs_remove_by_name_ns __kernfs_remove kernfs_drain
- Published
- Feb 26, 2025
- Updated
- Jun 17, 2026
- EPSS
- 0.2% · 21th percentile
- CWE
- CWE-416
Report tools
Action score
31
Monitor
Low priority for now.
- CVSS
- 31 / 40 · 7.8 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.2%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
Vulnrichment: CISA's decision-tree inputs.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| linux | linux kernel | cpe:2.3:o:linux:linux_kernel |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- linux linux kernel3.2.84 and later · before 3.3
- linux linux kernel3.10.103 and later · before 3.11
- linux linux kernel3.12.63 and later · before 3.13
- linux linux kernel3.14.77 and later · before 3.15
- linux linux kernel3.16.39 and later · before 3.17
- linux linux kernel3.18.40 and later · before 3.19
- linux linux kernel4.1.31 and later · before 4.2
- linux linux kernel4.4.19 and later · before 4.5
- linux linux kernel4.7.2 and later · before 4.14.276
- linux linux kernel4.15 and later · before 4.19.238
- linux linux kernel4.20 and later · before 5.4.189
- linux linux kernel5.5 and later · before 5.10.110
- linux linux kernel5.11 and later · before 5.15.33
- linux linux kernel5.16 and later · before 5.16.19
- linux linux kernel5.17 and later · before 5.17.2
Versions reported by the vendor
Affected version ranges reported by the assigning authority (Linux). Independent of NVD's CPE analysis and usually ahead of it.
Linux Linux
- 016820bde3f0895d09fcad370415085ba0d1bd4a, 12f567db822241090b90c5645ea9146f6cf8fa42, 31b0fca8ab9b9786fe6e5027c4a8587b47db5abf, 6117840dec60344167038f9511c3770d4c096eaa, bd7d3de27e7e1acce2e276074a498a82e0834663, cdf25333b42fb889f086ef65d0734d0dbdc49f4e, ae32d1b98ba29408df87c0ed47877ca0f248eae7, 4056337b1e81a1b137aa562133dc5430cd2fd19e, f3db4c640b32485105554e0bfd16bbde585f6fb0, 4.8affected
- 714fb87e8bc05ff78255afc0dca981e8c5242785 and later · before f149b1bd213820363731aa119e5011ca892a2aacaffected · git
- 714fb87e8bc05ff78255afc0dca981e8c5242785 and later · before a8ecee49259f8f78d91ddb329ab2be7e6fd01974affected · git
- 714fb87e8bc05ff78255afc0dca981e8c5242785 and later · before d727fd32cbd1abf3465f607021bc9c746f17b5a8affected · git
- 714fb87e8bc05ff78255afc0dca981e8c5242785 and later · before 432b057f8e847ae5a2306515606f8d2defaca178affected · git
- 714fb87e8bc05ff78255afc0dca981e8c5242785 and later · before 1a3f1cf87054833242fcd0218de0481cf855f888affected · git
- 714fb87e8bc05ff78255afc0dca981e8c5242785 and later · before c32fe764191b8ae8b128588beb96e3718d9179d8affected · git
- 714fb87e8bc05ff78255afc0dca981e8c5242785 and later · before 5f9e9c223e48c264241d2f34d0bfc29e5fcb5c1baffected · git
- 714fb87e8bc05ff78255afc0dca981e8c5242785 and later · before 3cbf0e392f173ba0ce425968c8374a6aa3e90f2eaffected · git
- 3.2.84 and later · before 3.3affected · semver
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:12 | linux | before 5.17.3-1 | 5.17.3-1 |
| SUSE:Linux Enterprise Live Patching 12 SP5 | kernel-default | before 4.12.14-122.250.1 | 4.12.14-122.250.1 |
| SUSE:Linux Enterprise Live Patching 12 SP5 | kgraft-patch-SLE12-SP5_Update_66 | before 1-8.3.1 | 1-8.3.1 |
| SUSE:Linux Enterprise Server 12 SP5-LTSS | kernel-source | before 4.12.14-122.250.1 | 4.12.14-122.250.1 |
| SUSE:Linux Enterprise Server 12 SP5-LTSS | kernel-syms | before 4.12.14-122.250.1 | 4.12.14-122.250.1 |
Same product
linux: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-31431crypto: algif_aead - Revert to operating out-of-placeKEV90Now
- CVE-2022-0847A flaw was found in the way the "flags" member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe KEV89Now
- CVE-2021-22555Heap Out-Of-Bounds Write in Netfilter IP6T_SO_SET_REPLACEKEV85Now
Published before and after this one in the same product
- ← EarlierCVE-2021-47632Feb 26, 2025 · powerpc/set_memory: Avoid spinlock recursion in change_page_attr()22Monitor
- ← EarlierCVE-2021-47633Feb 26, 2025 · ath5k: fix OOB in ath5k_eeprom_read_pcal_info_511128Monitor
- Later →CVE-2021-47635Feb 26, 2025 · ubifs: Fix to add refcount once page is set private22Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| Linux Linux | 1a3f1cf87054833242fcd0218de0481cf855f888 | Vendor (CNA) |
| Linux Linux | 3.11 | Vendor (CNA) |
| Linux Linux | 3.13 | Vendor (CNA) |
| Linux Linux | 3.15 | Vendor (CNA) |
| Linux Linux | 3.17 | Vendor (CNA) |
| Linux Linux | 3.19 | Vendor (CNA) |
| Linux Linux | 3.3 | Vendor (CNA) |
| Linux Linux | 3cbf0e392f173ba0ce425968c8374a6aa3e90f2e | Vendor (CNA) |
| Linux Linux | 4.2 | Vendor (CNA) |
| Linux Linux | 4.5 | Vendor (CNA) |
| Linux Linux | 4.8 | Vendor (CNA) |
| Linux Linux | 432b057f8e847ae5a2306515606f8d2defaca178 | Vendor (CNA) |
| Linux Linux | 5f9e9c223e48c264241d2f34d0bfc29e5fcb5c1b | Vendor (CNA) |
| Linux Linux | a8ecee49259f8f78d91ddb329ab2be7e6fd01974 | Vendor (CNA) |
| Linux Linux | c32fe764191b8ae8b128588beb96e3718d9179d8 | Vendor (CNA) |
| Linux Linux | d727fd32cbd1abf3465f607021bc9c746f17b5a8 | Vendor (CNA) |
| Linux Linux | f149b1bd213820363731aa119e5011ca892a2aac | Vendor (CNA) |
| debian:linux | 5.17.3-1 · Debian:12 | Package registry (OSV) |
| suse:kernel-default | 4.12.14-122.250.1 · SUSE:Linux Enterprise Live Patching 12 SP5 | Package registry (OSV) |
| suse:kernel-source | 4.12.14-122.250.1 · SUSE:Linux Enterprise Server 12 SP5-LTSS | Package registry (OSV) |
| suse:kernel-syms | 4.12.14-122.250.1 · SUSE:Linux Enterprise Server 12 SP5-LTSS | Package registry (OSV) |
| suse:kgraft-patch-SLE12-SP5_Update_66 | 1-8.3.1 · SUSE:Linux Enterprise Live Patching 12 SP5 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
No history yet (it accumulates with the daily EPSS job).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
No commit or PR link among the references.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Someone with local access to the system can trigger it.
- A low-privileged account is enough.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-416 · Use After FreeCVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
nvd-secondary
Root cause
After a memory region is freed, another reference pointing to it is still used. By then, the same region may have been allocated for different data.
The bug in code
The whole CWE-416 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
free(dev->buf);
/* ... another thread is still running ... */
process(dev->buf);Fixed
lock(&dev->lock);
free(dev->buf);
dev->buf = NULL;
unlock(&dev->lock);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
MITRE has no CAPEC/ATT&CK mapping for this CWE.
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (7 more)Show less
- git.kernel.org/stable/c/3cbf0e392f173ba0ce425968c8374a6aa3e90f2e
- git.kernel.org/stable/c/432b057f8e847ae5a2306515606f8d2defaca178
- git.kernel.org/stable/c/5f9e9c223e48c264241d2f34d0bfc29e5fcb5c1b
- git.kernel.org/stable/c/a8ecee49259f8f78d91ddb329ab2be7e6fd01974
- git.kernel.org/stable/c/c32fe764191b8ae8b128588beb96e3718d9179d8
- git.kernel.org/stable/c/d727fd32cbd1abf3465f607021bc9c746f17b5a8
- git.kernel.org/stable/c/f149b1bd213820363731aa119e5011ca892a2aac
Vendor advisories and official records. Exploit/PoC links are deliberately left out.