ocfs2: avoid moving extents to occupied clusters
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e6b5859cccfa0fec02f3c5b1069481efc7186f47 · < d5d5a21fb33cd9b963aea99da81e4dacd452cd95| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: avoid moving extents to occupied clusters
For non-auto OCFS2_IOC_MOVE_EXT operations, userspace supplies a physical me_goal. ocfs2_move_extent() initializes new_phys_cpos from that goal and expects ocfs2_probe_alloc_group() to replace it with a free run in the target block group.
The probe currently leaves *phys_cpos unchanged if the scan reaches the end of the group without finding a free run. An occupied goal at the last bit can therefore survive the probe and be passed to __ocfs2_move_extent(), which copies file data into a cluster still owned by another inode before the bitmap is updated.
When the probe does find a free run, it also subtracts move_len from the ending bit. The start of an N-bit run ending at i is i - N + 1, so the current calculation can report the bit immediately before the free run.
Clear *phys_cpos before scanning and use the correct free-run start. Callers already treat a zero result as -ENOSPC, so failed probes no longer continue with an occupied caller-controlled goal.
From the CVE record · Linux
The Linux kernel’s ocfs2 extent-move code can select an occupied cluster or a bit immediately before a free run. A local user who invokes a non-auto OCFS2_IOC_MOVE_EXT operation with a physical goal can cause file data to be copied into a cluster owned by another inode; the input does not specify authentication requirements.
Engineers running Linux kernels with ocfs2 should check whether their kernel includes the fix; affected versions are not specified.