Vulnerability · Published Apr 17, 2024 · Assigned by Linux
CVE-2024-26868nfs: fix panic when nfs4_ff_layout_prepare_ds() fails
High 7.5
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.6% (higher than 50% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: nfs: fix panic when nfs4_ff_layout_prepare_ds() fails We've been seeing the following panic in production BUG: kernel NULL pointer dereference, address: 0000000000000065 PGD 2f485f067 P4D 2f485f067 PUD 2cc5d8067 PMD 0 RIP: 0010:ff_layout_cancel_io+0x3a/0x90 [nfs_layout_flexfiles] Call Trace: <TASK> ? __die+0x78/0xc0 ? page_fault_oops+0x286/0x380 ? __rpc_execute+0x2c3/0x470 [sunrpc] ? rpc_new_task+0x42/0x1c0 [sunrpc] ? exc_page_fault+0x5d/0x110 ? asm_exc_page_fault+0x22/0x30 ? ff_layout_free_layoutreturn+0x110/0x110 [nfs_layout_flexfiles] ? ff_layout_cancel_io+0x3a/0x90 [nfs_layout_flexfiles] ? ff_layout_cancel_io+0x6f/0x90 [nfs_layout_flexfiles] pnfs_mark_matching_lsegs_return+0x1b0/0x360 [nfsv4] pnfs_error_mark_layout_for_return+0x9e/0x110 [nfsv4] ? ff_layout_send_layouterror+0x50/0x160 [nfs_layout_flexfiles] nfs4_ff_layout_prepare_ds+0x11f/0x290 [nfs_layout_flexfiles] ff_layout_pg_init_write+0xf0/0x1f0 [nfs_layout_flexfiles] __nfs_pageio_add_request+0x154/0x6c0 [nfs] nfs_pageio_add_request+0x26b/0x380 [nfs] nfs_do_writepage+0x111/0x1e0 [nfs] nfs_writepages_callback+0xf/0x30 [nfs] write_cache_pages+0x17f/0x380 ? nfs_pageio_init_write+0x50/0x50 [nfs] ? nfs_writepages+0x6d/0x210 [nfs] ? nfs_writepages+0x6d/0x210 [nfs] nfs_writepages+0x125/0x210 [nfs] do_writepages+0x67/0x220 ? generic_perform_write+0x14b/0x210 filemap_fdatawrite_wbc+0x5b/0x80 file_write_and_wait_range+0x6d/0xc0 nfs_file_fsync+0x81/0x170 [nfs] ? nfs_file_mmap+0x60/0x60 [nfs] __x64_sys_fsync+0x53/0x90 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Inspecting the core with drgn I was able to pull this >>> prog.crashed_thread().stack_trace()[0] #0 at 0xffffffffa079657a (ff_layout_cancel_io+0x3a/0x84) in ff_layout_cancel_io at fs/nfs/flexfilelayout/flexfilelayout.c:2021:27 >>> prog.crashed_thread().stack_trace()[0]['idx'] (u32)1 >>> prog.crashed_thread().stack_trace()[0]['flseg'].mirror_array[1].mirror_ds (struct nfs4_ff_layout_ds *)0xffffffffffffffed This is clear from the stack trace, we call nfs4_ff_layout_prepare_ds() which could error out initializing the mirror_ds, and then we go to clean it all up and our check is only for if (!mirror->mirror_ds). This is inconsistent with the rest of the users of mirror_ds, which have if (IS_ERR_OR_NULL(mirror_ds)) to keep from tripping over this exact scenario. Fix this up in ff_layout_cancel_io() to make sure we don't panic when we get an error. I also spot checked all the other instances of checking mirror_ds and we appear to be doing the correct checks everywhere, only unconditionally dereferencing mirror_ds when we know it would be valid.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:9 | bpftool | 7.3.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-debug | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-debug-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-debug-devel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-debug-devel-matched | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-debug-modules | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-debug-modules-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-debug-modules-extra | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-devel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-devel-matched | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-modules | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-modules-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-64k-modules-extra | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-abi-stablelists | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-cross-headers | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-debug | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-debug-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-debug-devel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-debug-devel-matched | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-debug-modules | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-debug-modules-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-debug-modules-extra | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-debug-uki-virt | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-devel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-devel-matched | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-doc | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-headers | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-modules | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-modules-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-modules-extra | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-debug | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-debug-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-debug-devel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-debug-modules | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-debug-modules-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-debug-modules-extra | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-devel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-modules | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-modules-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-rt-modules-extra | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-tools | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-tools-libs | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-tools-libs-devel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-uki-virt | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-zfcpdump | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-zfcpdump-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-zfcpdump-devel | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-zfcpdump-devel-matched | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-zfcpdump-modules | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-zfcpdump-modules-core | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | kernel-zfcpdump-modules-extra | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | libperf | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | perf | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | python3-perf | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | rtla | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| AlmaLinux:9 | rv | 5.14.0-427.31.1.el9_4 | ALSA-2024:5363 |
| Debian:12 | linux | 6.1.85-1 | DEBIAN-CVE-2024-26868 |
| Debian:13 | linux | 6.7.12-1 | DEBIAN-CVE-2024-26868 |
| Debian:14 | linux | 6.7.12-1 | DEBIAN-CVE-2024-26868 |
| Rocky Linux:9 | kernel | 0:5.14.0-427.31.1.el9_4 | RLSA-2024:5363 |
| Ubuntu:24.04:LTS | linux | 6.8.0-35.35 | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux | 6.8.0-35.35 | USN-6816-1 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1009.9 | USN-6817-1 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1009.9 | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1008.8 | USN-6817-3 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1008.8 | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1008.9 | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1008.9 | USN-6817-1 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1004.7 | USN-6817-3 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1004.7 | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1006.6 | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1006.6 | USN-6816-1 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-35.35.1 | USN-6816-1 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-35.35.1 | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1006.6 | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1006.6 | USN-6817-2 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1006.6 | USN-6878-1 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1006.6 | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1005.5 | USN-6816-1 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1005.5 | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-35.35.1 | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-26868 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-26868 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | b739a5bd9d9f18cc69dced8db128ef7206e000cd – before 31db25e3141b20e2a76a9f219eeca52e3cab126cb739a5bd9d9f18cc69dced8db128ef7206e000cd – before 7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5b739a5bd9d9f18cc69dced8db128ef7206e000cd – before 5ada9016b1217498fad876a3d5b07645cc955608b739a5bd9d9f18cc69dced8db128ef7206e000cd – before dac068f164ad05b35e7c0be13f138c3f6adca58fb739a5bd9d9f18cc69dced8db128ef7206e000cd – before 719fcafe07c12646691bd62d7f8d94d657fa0766 |
| Linux | Linux | 6.1 |
References
- https://git.kernel.org/stable/c/31db25e3141b20e2a76a9f219eeca52e3cab126c
- https://git.kernel.org/stable/c/7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5
- https://git.kernel.org/stable/c/5ada9016b1217498fad876a3d5b07645cc955608
- https://git.kernel.org/stable/c/dac068f164ad05b35e7c0be13f138c3f6adca58f
- https://git.kernel.org/stable/c/719fcafe07c12646691bd62d7f8d94d657fa0766