ocfs2: reject dinodes with non-canonical i_mode type
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b657c95c11088d77fc1bfc9c84d940f778bf9d12 · < 4db3b6a2a8ecf2a89d26a4090ace4072c6fad050| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: reject dinodes with non-canonical i_mode type
Patch series "ocfs2: harden inode validators against forged metadata", v2.
This series adds three structural checks to OCFS2 dinode validation so malformed on-disk fields are rejected before ocfs2_populate_inode() copies them into the in-core inode.
The checks cover:
- i_mode values whose type bits do not name a canonical POSIX file type; - non-device dinodes whose id1.dev1.i_rdev field is non-zero; and - non-inline dinodes that claim non-zero i_size while i_clusters is zero, covering directories unconditionally and regular files on non-sparse volumes.
The normal read path reports these through ocfs2_error(), matching the existing suballoc-slot, inline-data, chain-list, and refcount checks. The online filecheck path uses the same structural predicates but keeps its own reporting contract, returning OCFS2_FILECHECK_ERR_INVALIDINO instead of calling ocfs2_error().
This patch (of 3):
From the CVE record · Linux
OCFS2 inode validation accepts on-disk i_mode values that do not identify a canonical POSIX file type. If malformed OCFS2 metadata is read, the kernel can pass the inode to special-file handling instead of rejecting it; the input does not specify how an attacker could supply that metadata.
Engineers running Linux systems that use OCFS2 should check their kernel version; affected versions are not specified.