ext4: fix use-after-free in ext4_orphan_cleanup
Published Dec 9, 2025
7.8
HIGHCVSS 3.1
EPSS 0.21%
Description
I caught a issue as follows: ================================================================== BUG: KASAN: use-after-free in __list_add_valid+0x28/0x1a0 Read of size 8 at addr ffff88814b13f378 by task mount/710
CPU: 1 PID: 710 Comm: mount Not tainted 6.1.0-rc3-next #370 Call Trace: <TASK> dump_stack_lvl+0x73/0x9f print_report+0x25d/0x759 kasan_report+0xc0/0x120 __asan_load8+0x99/0x140 __list_add_valid+0x28/0x1a0 ext4_orphan_cleanup+0x564/0x9d0 [ext4] __ext4_fill_super+0x48e2/0x5300 [ext4] ext4_fill_super+0x19f/0x3a0 [ext4] get_tree_bdev+0x27b/0x450 ext4_get_tree+0x19/0x30 [ext4] vfs_get_tree+0x49/0x150 path_mount+0xaae/0x1350 do_mount+0xe2/0x110 __x64_sys_mount+0xf0/0x190 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK> [...] ==================================================================
Above issue may happen as follows: ------------------------------------- ext4_fill_super ext4_orphan_cleanup --- loop1: assume last_orphan is 12 --- list_add(&EXT4_I(inode)->i_orphan, &EXT4_SB(sb)->s_orphan) ext4_truncate --> return 0 ext4_inode_attach_jinode --> return -ENOMEM iput(inode) --> free inode<12> --- loop2: last_orphan is still 12 --- list_add(&EXT4_I(inode)->i_orphan, &EXT4_SB(sb)->s_orphan); // use inode<12> and trigger UAF
To solve this issue, we need to propagate the return value of ext4_inode_attach_jinode() appropriately.
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 4.10StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<4.10
- Version 4.19.270StatusunaffectedConstraints<=4.19.*
- Version 5.10.163StatusunaffectedConstraints<=5.10.*
- Version 5.15.87StatusunaffectedConstraints<=5.15.*
- Version 5.4.229StatusunaffectedConstraints<=5.4.*
- Version 6.0.18StatusunaffectedConstraints<=6.0.*
- Version 6.1.4StatusunaffectedConstraints<=6.1.*
- Version 6.2StatusunaffectedConstraints<=*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Linux | Linux | unaffected |
| ||||||||||||||||||||||||||||||
| Linux | Linux | affected |
|
No data.
No data.
Red Hat Enterprise Linux 7 Extended Lifecycle Support
kernel-0:3.10.0-1160.147.1.el7
Fixed · RHSA-2026:3685
Red Hat Enterprise Linux 7 Extended Lifecycle Support
kernel-rt-0:3.10.0-1160.147.1.rt56.1299.el7
Fixed · RHSA-2026:3634
Red Hat Enterprise Linux 8
kernel-0:4.18.0-553.104.1.el8_10
Fixed · RHSA-2026:2264
Red Hat Enterprise Linux 8
kernel-rt-0:4.18.0-553.104.1.rt7.445.el8_10
Fixed · RHSA-2026:2378
Red Hat Enterprise Linux 8.2 Advanced Update Support
kernel-0:4.18.0-193.185.1.el8_2
Fixed · RHSA-2026:2664
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support
kernel-0:4.18.0-305.186.1.el8_4
Fixed · RHSA-2026:3360
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On
kernel-0:4.18.0-305.186.1.el8_4
Fixed · RHSA-2026:3360
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support
kernel-0:4.18.0-372.179.1.el8_6
Fixed · RHSA-2026:2490
Red Hat Enterprise Linux 8.6 Telecommunications Update Service
kernel-0:4.18.0-372.179.1.el8_6
Fixed · RHSA-2026:2490
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions
kernel-0:4.18.0-372.179.1.el8_6
Fixed · RHSA-2026:2490
Red Hat Enterprise Linux 8.8 Telecommunications Update Service
kernel-0:4.18.0-477.130.1.el8_8
Fixed · RHSA-2026:3277
Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions
kernel-0:4.18.0-477.130.1.el8_8
Fixed · RHSA-2026:3277
Red Hat Enterprise Linux 9
kernel-0:5.14.0-427.13.1.el9_4
Fixed · RHSA-2024:2394
Red Hat Enterprise Linux 9
kernel-0:5.14.0-427.13.1.el9_4
Fixed · RHSA-2024:2394
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions
kernel-0:5.14.0-70.165.1.el9_0
Fixed · RHSA-2026:2573
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions
kernel-rt-0:5.14.0-70.165.1.rt21.237.el9_0
Fixed · RHSA-2026:2577
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions
kernel-0:5.14.0-284.158.1.el9_2
Fixed · RHSA-2026:3267
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions
kernel-rt-0:5.14.0-284.158.1.rt14.443.el9_2
Fixed · RHSA-2026:3358
Red Hat Enterprise Linux 10
kernel
Not affected
Red Hat Enterprise Linux 6
kernel
Out of support scope
Red Hat Enterprise Linux 9
kernel-rt
Fix deferred
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 7 Extended Lifecycle Support | kernel-0:3.10.0-1160.147.1.el7 | Fixed | RHSA-2026:3685 |
| Red Hat Enterprise Linux 7 Extended Lifecycle Support | kernel-rt-0:3.10.0-1160.147.1.rt56.1299.el7 | Fixed | RHSA-2026:3634 |
| Red Hat Enterprise Linux 8 | kernel-0:4.18.0-553.104.1.el8_10 | Fixed | RHSA-2026:2264 |
| Red Hat Enterprise Linux 8 | kernel-rt-0:4.18.0-553.104.1.rt7.445.el8_10 | Fixed | RHSA-2026:2378 |
| Red Hat Enterprise Linux 8.2 Advanced Update Support | kernel-0:4.18.0-193.185.1.el8_2 | Fixed | RHSA-2026:2664 |
| Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support | kernel-0:4.18.0-305.186.1.el8_4 | Fixed | RHSA-2026:3360 |
| Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On | kernel-0:4.18.0-305.186.1.el8_4 | Fixed | RHSA-2026:3360 |
| Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support | kernel-0:4.18.0-372.179.1.el8_6 | Fixed | RHSA-2026:2490 |
| Red Hat Enterprise Linux 8.6 Telecommunications Update Service | kernel-0:4.18.0-372.179.1.el8_6 | Fixed | RHSA-2026:2490 |
| Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions | kernel-0:4.18.0-372.179.1.el8_6 | Fixed | RHSA-2026:2490 |
| Red Hat Enterprise Linux 8.8 Telecommunications Update Service | kernel-0:4.18.0-477.130.1.el8_8 | Fixed | RHSA-2026:3277 |
| Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions | kernel-0:4.18.0-477.130.1.el8_8 | Fixed | RHSA-2026:3277 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-427.13.1.el9_4 | Fixed | RHSA-2024:2394 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-427.13.1.el9_4 | Fixed | RHSA-2024:2394 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | kernel-0:5.14.0-70.165.1.el9_0 | Fixed | RHSA-2026:2573 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | kernel-rt-0:5.14.0-70.165.1.rt21.237.el9_0 | Fixed | RHSA-2026:2577 |
| Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions | kernel-0:5.14.0-284.158.1.el9_2 | Fixed | RHSA-2026:3267 |
| Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions | kernel-rt-0:5.14.0-284.158.1.rt14.443.el9_2 | Fixed | RHSA-2026:3358 |
| Red Hat Enterprise Linux 10 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 6 | kernel | Out of support scope | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Fix deferred | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
This issue is triggered by a specially crafted disk image containing on-disk metadata inconsistencies. Exploitation requires that an attacker convince a user to download and use a malicious image from an untrusted source, a scenario with limited practical impact. Red Hat rates this as Low severity.
References (12)
- https://access.redhat.com/security/cve/CVE-2022-50673 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2420347 Issue Tracking
- https://git.kernel.org/stable/c/026a4490b5381229a30f23d073b58e8e35ee6858
- https://git.kernel.org/stable/c/7223d5e75f26352354ea2c0ccf8b579821b52adf
- https://git.kernel.org/stable/c/7908b8a541b1578cc61b4da7f19b604a931441da
- https://git.kernel.org/stable/c/7f801a1593cb957f73659732836b2dafbdfc7709
- https://git.kernel.org/stable/c/a71248b1accb2b42e4980afef4fa4a27fa0e36f5
- https://git.kernel.org/stable/c/c2bdbd4c69308835d1b6f6ba74feeccbfe113478
- https://git.kernel.org/stable/c/cf0e0817b0f925b70d101d7014ea81b7094e1159
- https://lore.kernel.org/linux-cve-announce/2025120947-CVE-2022-50673-f920@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2022-50673
- https://www.cve.org/CVERecord?id=CVE-2022-50673
Change history (0)
No recorded changes yet.