nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_save_to_shadow_map
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e897be17a441fa637cd166fc3de1445131e57692 · < c36e206f302f1ddefed92d09ecbba070e1ae079e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_save_to_shadow_map
The DAT inode's btree node cache (i_assoc_inode) is initialized lazily during btree operations. However, nilfs_mdt_save_to_shadow_map() assumes i_assoc_inode is already initialized when copying dirty pages to the shadow map during GC.
If NILFS_IOCTL_CLEAN_SEGMENTS is called immediately after mount before any btree operation has occurred on the DAT inode, i_assoc_inode is NULL leading to a general protection fault.
Fix this by calling nilfs_attach_btree_node_cache() on the DAT inode in nilfs_dat_read() at mount time, ensuring i_assoc_inode is always initialized before any GC operation can use it.
From the CVE record · Linux
The nilfs2 filesystem can dereference a NULL pointer during garbage collection if NILFS_IOCTL_CLEAN_SEGMENTS is called immediately after mount, before a DAT inode btree operation. A local caller invoking the ioctl under those conditions can trigger a general protection fault. The input does not specify authentication requirements.
Engineers running Linux kernels with nilfs2 should check their versions; affected versions are not specified.