CVE-2025-40233

Source
https://cve.org/CVERecord?id=CVE-2025-40233
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40233.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-40233
Downstream
Related
Published
2025-12-04T15:31:23.891Z
Modified
2026-03-11T07:46:59.154072838Z
Summary
ocfs2: clear extent cache after moving/defragmenting extents
Details

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

ocfs2: clear extent cache after moving/defragmenting extents

The extent map cache can become stale when extents are moved or defragmented, causing subsequent operations to see outdated extent flags. This triggers a BUGON in ocfs2refcountcalcow_clusters().

The problem occurs when: 1. copyfilerange() creates a reflinked extent with OCFS2EXTREFCOUNTED 2. ioctl(FITRIM) triggers ocfs2moveextents() 3. __ocfs2moveextents_range() reads and caches the extent (flags=0x2) 4. ocfs2moveextent()/ocfs2defragextent() calls __ocfs2moveextent() which clears OCFS2EXTREFCOUNTED flag on disk (flags=0x0) 5. The extent map cache is not invalidated after the move 6. Later write() operations read stale cached flags (0x2) but disk has updated flags (0x0), causing a mismatch 7. BUGON(!(rec->eflags & OCFS2EXTREFCOUNTED)) triggers

Fix by clearing the extent map cache after each extent move/defrag operation in _ocfs2moveextentsrange(). This ensures subsequent operations read fresh extent data from disk.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40233.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
53069d4e76954e2e63c1b3c501051c6fbcf7298c
Fixed
93166bc53c0e3587058327a4121daea34b4fecd5
Fixed
a7ee72286efba1d407c6f15a0528e43593fb7007
Fixed
93b1ab422f1966b71561158e1aedce4ec100f357
Fixed
e92af7737a94a729225d2a5d180eaaa77fe0bbc1
Fixed
aa6a21409dd6221bb268b56bb410e031c632ff9a
Fixed
bb69928ed578f881e68d26aaf1a8f6e7faab3b44
Fixed
a21750df2f6169af6e039a3bb4893d6c9564e48d
Fixed
78a63493f8e352296dbc7cb7b3f4973105e8679e

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40233.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.0.0
Fixed
5.4.301
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.246
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.196
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.158
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.115
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.56
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.17.6

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40233.json"