CVE-2024-39371: io_uring: check for non-NULL file pointer in io_file_can_poll()

Published Jun 25, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

iouring: check for non-NULL file pointer in iofilecanpoll()

In earlier kernels, it was possible to trigger a NULL pointer dereference off the forced async preparation path, if no file had been assigned. The trace leading to that looks as follows:

BUG: kernel NULL pointer dereference, address: 00000000000000b0 PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP CPU: 67 PID: 1633 Comm: buf-ring-invali Not tainted 6.8.0-rc3+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS unknown 2/2/2022 RIP: 0010:iobufferselect+0xc3/0x210 Code: 00 00 48 39 d1 0f 82 ae 00 00 00 48 81 4b 48 00 00 01 00 48 89 73 70 0f b7 50 0c 66 89 53 42 85 ed 0f 85 d2 00 00 00 48 8b 13 <48> 8b 92 b0 00 00 00 48 83 7a 40 00 0f 84 21 01 00 00 4c 8b 20 5b RSP: 0018:ffffb7bec38c7d88 EFLAGS: 00010246 RAX: ffff97af2be61000 RBX: ffff97af234f1700 RCX: 0000000000000040 RDX: 0000000000000000 RSI: ffff97aecfb04820 RDI: ffff97af234f1700 RBP: 0000000000000000 R08: 0000000000200030 R09: 0000000000000020 R10: ffffb7bec38c7dc8 R11: 000000000000c000 R12: ffffb7bec38c7db8 R13: ffff97aecfb05800 R14: ffff97aecfb05800 R15: ffff97af2be5e000 FS: 00007f852f74b740(0000) GS:ffff97b1eeec0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000b0 CR3: 000000016deab005 CR4: 0000000000370ef0 Call Trace: <TASK> ? die+0x1f/0x60 ? pagefaultoops+0x14d/0x420 ? douseraddrfault+0x61/0x6a0 ? excpagefault+0x6c/0x150 ? asmexcpagefault+0x22/0x30 ? iobufferselect+0xc3/0x210 ioimportiovec+0xb5/0x120 ioreadvprepasync+0x36/0x70 ioqueuesqefallback+0x20/0x260 iosubmitsqes+0x314/0x630 dosysiouringenter+0x339/0xbc0 ? dosysiouringregister+0x11b/0xc50 ? vmmmappgoff+0xce/0x160 dosyscall64+0x5f/0x180 entrySYSCALL64afterhwframe+0x46/0x4e RIP: 0033:0x55e0a110a67e Code: ba cc 00 00 00 45 31 c0 44 0f b6 92 d0 00 00 00 31 d2 41 b9 08 00 00 00 41 83 e2 01 41 c1 e2 04 41 09 c2 b8 aa 01 00 00 0f 05 <c3> 90 89 30 eb a9 0f 1f 40 00 48 8b 42 20 8b 00 a8 06 75 af 85 f6

because the request is marked forced ASYNC and has a bad file fd, and hence takes the forced async prep path.

Current kernels with the request async prep cleaned up can no longer hit this issue, but for ease of backporting, let's add this safety check in here too as it really doesn't hurt. For both cases, this will inevitably end with a CQE posted with -EBADF.

Affected Software

7 affected componentsFixes available
Linux Linux kernel>=5.19<6.1.95
Linux Linux kernel>=6.2<6.6.35
Linux Linux kernel>=6.7<6.9.5
Linux Linux kernel=6.10-rc1
Linux Linux kernel=6.10-rc2
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-1
debian/linux-6.1
6.1.129-1~deb11u1

Event History

Jun 25, 2024
CVE Published
via MITRE·02:22 PM
Data Sourced
via MITRE·02:22 PM
Description
Data Sourced
via NVD·03:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Nov 30, 2024
Data Sourced
via Ubuntu·04:43 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-39371?

CVE-2024-39371 has been assigned a high severity rating due to the potential for NULL pointer dereference in the Linux kernel.

2

How do I fix CVE-2024-39371?

To fix CVE-2024-39371, upgrade to the patched versions of the Linux kernel as specified in official advisories.

3

Which versions of the Linux kernel are affected by CVE-2024-39371?

CVE-2024-39371 affects specific versions of the Linux kernel ranging from 5.19 up to 6.10-rc2.

4

What impact does CVE-2024-39371 have on system security?

CVE-2024-39371 could lead to a system crash if exploited, making it critical to apply fixes promptly.

5

Is CVE-2024-39371 specific to any Linux distributions?

CVE-2024-39371 is primarily related to the Linux kernel and may affect all distributions using the vulnerable versions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203