Linux kernel use-after-free in overlayfs mkdir debug logging
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ovl: fix UAF in ovl_do_mkdir() debug print
ovl_do_mkdir() prints the input dentry with %pd after vfs_mkdir(). Since commit fe497f0759e0 ("VFS: change vfs_mkdir() to unlock on failure."), vfs_mkdir() calls end_creating() on the input dentry on failure and may replace it on success, so the post-call %pd can use-after-free the dentry when CONFIG_OVERLAY_FS_DEBUG is enabled.
Print the dentry before the call and only the result afterward.
From the CVE record · Linux
The Linux kernel’s OverlayFS debug print can access a freed dentry after a mkdir operation when CONFIG_OVERLAY_FS_DEBUG is enabled. This can occur if vfs_mkdir() fails or replaces the input dentry on success; the input does not specify an attacker access requirement or a demonstrated exploit.
Engineers running Linux kernels with CONFIG_OVERLAY_FS_DEBUG enabled should check whether their kernel includes the fix; affected versions are not specified.