Squashfs: fix uninit-value in squashfs_get_parent
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 122601408d20c77704268f1dea9f9ce4abf997c2 · < 1b3ccd0019132880c94bb00ca7088c1749308f82| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Squashfs: fix uninit-value in squashfs_get_parent
Syzkaller reports a "KMSAN: uninit-value in squashfs_get_parent" bug.
This is caused by open_by_handle_at() being called with a file handle containing an invalid parent inode number. In particular the inode number is that of a symbolic link, rather than a directory.
Squashfs_get_parent() gets called with that symbolic link inode, and accesses the parent member field.
unsigned int parent_ino = squashfs_i(inode)->parent;
Because non-directory inodes in Squashfs do not have a parent value, this is uninitialised, and this causes an uninitialised value access.
The fix is to initialise parent with the invalid inode 0, which will cause an EINVAL error to be returned.
From the CVE record · Linux
The Linux kernel’s Squashfs code can access an uninitialized parent inode value. A local caller can trigger this by passing open_by_handle_at() a file handle whose invalid parent inode number refers to a symbolic link rather than a directory. The input does not specify an authentication requirement or user-interaction condition.
Engineers running Linux kernels with Squashfs should check their kernel version; affected versions are not specified.