Vulnerability · Published Jul 30, 2024 · Assigned by Linux

CVE-2024-42105nilfs2: fix inode number range checks

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 18% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.3%top 82.2% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: nilfs2: fix inode number range checks Patch series "nilfs2: fix potential issues related to reserved inodes". This series fixes one use-after-free issue reported by syzbot, caused by nilfs2's internal inode being exposed in the namespace on a corrupted filesystem, and a couple of flaws that cause problems if the starting number of non-reserved inodes written in the on-disk super block is intentionally (or corruptly) changed from its default value. This patch (of 3): In the current implementation of nilfs2, "nilfs->ns_first_ino", which gives the first non-reserved inode number, is read from the superblock, but its lower limit is not checked. As a result, if a number that overlaps with the inode number range of reserved inodes such as the root directory or metadata files is set in the super block parameter, the inode number test macros (NILFS_MDT_INODE and NILFS_VALID_INODE) will not function properly. In addition, these test macros use left bit-shift calculations using with the inode number as the shift count via the BIT macro, but the result of a shift calculation that exceeds the bit width of an integer is undefined in the C specification, so if "ns_first_ino" is set to a large value other than the default value NILFS_USER_INO (=11), the macros may potentially malfunction depending on the environment. Fix these issues by checking the lower bound of "nilfs->ns_first_ino" and by preventing bit shifts equal to or greater than the NILFS_USER_INO constant in the inode number test macros. Also, change the type of "ns_first_ino" from signed integer to unsigned integer to avoid the need for type casting in comparisons such as the lower bound check introduced this time.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.98-1DEBIAN-CVE-2024-42105
Debian:13linux6.9.9-1DEBIAN-CVE-2024-42105
Debian:14linux6.9.9-1DEBIAN-CVE-2024-42105
Ubuntu:22.04:LTSlinux5.15.0-121.131UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux6.8.0-48.48UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-aws5.15.0-1069.75UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-aws6.8.0-1018.20UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1018.19~22.04.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-azure5.15.0-1072.81UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-azure6.8.0-1017.20UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1017.20~22.04.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1072.81.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-gcp5.15.0-1068.76UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-gcp6.8.0-1017.19UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1017.19~22.04.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-gke5.15.0-1066.72UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-gke6.8.0-1013.17UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1052.59UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1002.4UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-48.48~22.04.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-ibm5.15.0-1062.65UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-ibm6.8.0-1015.15UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1015.15~22.04.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1064.70UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-kvm5.15.0-1066.71UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-121.131UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-48.48.3UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-48.48.3~22.04.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1064.65UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1017.19UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1017.19~22.04.1UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1017.19.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1028.28UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1016.16UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1016.16UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-oracle5.15.0-1067.73UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-oracle6.8.0-1015.16UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1015.15~22.04.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-raspi5.15.0-1062.65UBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-raspi6.8.0-1014.16UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-riscv6.8.0-48.48.1UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-48.48.1~22.04.2UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-42105
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1009.10UBUNTU-CVE-2024-42105
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1035.39UBUNTU-CVE-2024-42105

Affected products (as reported)

VendorProductVersions
Linux Linux 8a9d2191e9f43bbcd256a9a6871bd73434c83f2f – before 57235c3c88bb430043728d0d02f44a4efe3864768a9d2191e9f43bbcd256a9a6871bd73434c83f2f – before 08cab183a624ba71603f3754643ae11cab34dbc48a9d2191e9f43bbcd256a9a6871bd73434c83f2f – before 731011ac6c37cbe97ece229fc6daa486276052c58a9d2191e9f43bbcd256a9a6871bd73434c83f2f – before 3be4dcc8d7bea52ea41f87aa4bbf959efe7a59878a9d2191e9f43bbcd256a9a6871bd73434c83f2f – before fae1959d6ab2c52677b113935e36ab4e25df37ea8a9d2191e9f43bbcd256a9a6871bd73434c83f2f – before 9194f8ca57527958bee207919458e372d638d7838a9d2191e9f43bbcd256a9a6871bd73434c83f2f – before 1c91058425a01131ea30dda6cf43c67b17884d6a8a9d2191e9f43bbcd256a9a6871bd73434c83f2f – before e2fec219a36e0993642844be0f345513507031f4
Linux Linux 2.6.30

References