CVE-2024-58018: nvkm: correctly calculate the available space of the GSP cmdq buffer

Published Feb 27, 2025
·
Updated

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

nvkm: correctly calculate the available space of the GSP cmdq buffer

r535gspcmdqpush() waits for the available page in the GSP cmdq buffer when handling a large RPC request. When it sees at least one available page in the cmdq, it quits the waiting with the amount of free buffer pages in the queue.

Unfortunately, it always takes the [write pointer, bufsize) as available buffer pages before rolling back and wrongly calculates the size of the data should be copied. Thus, it can overwrite the RPC request that GSP is currently reading, which causes GSP hang due to corrupted RPC request:

[ 549.209389] ------------[ cut here ]------------ [ 549.214010] WARNING: CPU: 8 PID: 6314 at drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:116 r535gspmsgqwait+0xd0/0x190 [nvkm] [ 549.225678] Modules linked in: nvkm(E+) gsplog(E) sndseqdummy(E) sndhrtimer(E) sndseq(E) sndtimer(E) sndseqdevice(E) snd(E) soundcore(E) rfkill(E) qrtr(E) vfat(E) fat(E) ipmissif(E) amdatl(E) intelraplmsr(E) intelraplcommon(E) mlx5ib(E) amd64edac(E) edacmceamd(E) kvmamd(E) ibuverbs(E) kvm(E) ibcore(E) acpiipmi(E) ipmisi(E) mxmwmi(E) ipmidevintf(E) rapl(E) i2cpiix4(E) wmibmof(E) joydev(E) ptdma(E) acpicpufreq(E) k10temp(E) pcspkr(E) ipmimsghandler(E) xfs(E) libcrc32c(E) ast(E) i2calgobit(E) crct10difpclmul(E) drmshmemhelper(E) nvmetcp(E) crc32pclmul(E) ahci(E) drmkmshelper(E) libahci(E) nvmefabrics(E) crc32cintel(E) nvme(E) cdcether(E) mlx5core(E) nvmecore(E) usbnet(E) drm(E) libata(E) ccp(E) ghashclmulniintel(E) mii(E) t10pi(E) mlxfw(E) sp5100tco(E) psample(E) pcihypervintf(E) wmi(E) dmmultipath(E) sunrpc(E) dmmirror(E) dmregionhash(E) dmlog(E) dmmod(E) be2iscsi(E) bnx2i(E) cnic(E) uio(E) cxgb4i(E) cxgb4(E) tls(E) libcxgbi(E) libcxgb(E) qla4xxx(E) [ 549.225752] iscsibootsysfs(E) iscsitcp(E) libiscsitcp(E) libiscsi(E) scsitransportiscsi(E) fuse(E) [last unloaded: gsplog(E)] [ 549.326293] CPU: 8 PID: 6314 Comm: insmod Tainted: G E 6.9.0-rc6+ #1 [ 549.334039] Hardware name: ASRockRack 1U1G-MILAN/N/ROMED8-NL, BIOS L3.12E 09/06/2022 [ 549.341781] RIP: 0010:r535gspmsgqwait+0xd0/0x190 [nvkm] [ 549.347343] Code: 08 00 00 89 da c1 e2 0c 48 8d ac 11 00 10 00 00 48 8b 0c 24 48 85 c9 74 1f c1 e0 0c 4c 8d 6d 30 83 e8 30 89 01 e9 68 ff ff ff <0f> 0b 49 c7 c5 92 ff ff ff e9 5a ff ff ff ba ff ff ff ff be c0 0c [ 549.366090] RSP: 0018:ffffacbccaaeb7d0 EFLAGS: 00010246 [ 549.371315] RAX: 0000000000000000 RBX: 0000000000000012 RCX: 0000000000923e28 [ 549.378451] RDX: 0000000000000000 RSI: 0000000055555554 RDI: ffffacbccaaeb730 [ 549.385590] RBP: 0000000000000001 R08: ffff8bd14d235f70 R09: ffff8bd14d235f70 [ 549.392721] R10: 0000000000000002 R11: ffff8bd14d233864 R12: 0000000000000020 [ 549.399854] R13: ffffacbccaaeb818 R14: 0000000000000020 R15: ffff8bb298c67000 [ 549.406988] FS: 00007f5179244740(0000) GS:ffff8bd14d200000(0000) knlGS:0000000000000000 [ 549.415076] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 549.420829] CR2: 00007fa844000010 CR3: 00000001567dc005 CR4: 0000000000770ef0 [ 549.427963] PKRU: 55555554 [ 549.430672] Call Trace: [ 549.433126] <TASK> [ 549.435233] ? warn+0x7f/0x130 [ 549.438473] ? r535gspmsgqwait+0xd0/0x190 [nvkm] [ 549.443426] ? reportbug+0x18a/0x1a0 [ 549.447098] ? handlebug+0x3c/0x70 [ 549.450589] ? excinvalidop+0x14/0x70 [ 549.454430] ? asmexcinvalidop+0x16/0x20 [ 549.458619] ? r535gspmsgqwait+0xd0/0x190 [nvkm] [ 549.463565] r535gspmsgrecv+0x46/0x230 [nvkm] [ 549.468257] r535gsprpcpush+0x106/0x160 [nvkm] [ 549.473033] r535gsprpcrmctrlpush+0x40/0x130 [nvkm] [ 549.478422] nvidiagridinitvgputypes+0xbc/0xe0 [nvkm] [ 549.483899] nvidiagridinit+0xb1/0xd0 [nvkm] [ 549.488420] ? srsoaliasreturnthunk+0x5/0xfbef5 [ 549.493213] nvkmdevicepciprobe+0x305/0x420 [nvkm] [ 549.498338] localpciprobe+0x46/ ---truncated---

Affected Software

122 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=6.7<6.12.14
Linux Linux kernel>=6.13<6.13.3
debian/linux<6.12.15-1
6.12.15-1
debian/linux<6.12.15-1
6.12.15-1
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1
ubuntu/linux-hwe-edge*
ubuntu/linux-aws-5.0*
ubuntu/linux-aws-5.3*
ubuntu/linux-azure*
ubuntu/linux-azure-5.3*
ubuntu/linux-azure-edge*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.3*
ubuntu/linux-gke-4.15*
ubuntu/linux-gke-5.4*
ubuntu/linux-gkeop-5.4*
ubuntu/linux-hwe*
ubuntu/linux-hwe-edge*
ubuntu/linux-oem*
ubuntu/linux-oracle-5.0*
ubuntu/linux-oracle-5.3*
ubuntu/linux-aws-5.11*
ubuntu/linux-aws-5.13*
ubuntu/linux-aws-5.8*
ubuntu/linux-azure-5.11*
ubuntu/linux-azure-5.13*
ubuntu/linux-azure-5.8*
ubuntu/linux-azure-fde*
ubuntu/linux-gcp-5.11*
ubuntu/linux-gcp-5.13*
ubuntu/linux-gcp-5.8*
ubuntu/linux-gke*
ubuntu/linux-gke-5.15*
ubuntu/linux-gkeop*
ubuntu/linux-gkeop-5.15*
ubuntu/linux-hwe-5.11*
ubuntu/linux-hwe-5.13*
ubuntu/linux-hwe-5.8*
ubuntu/linux-intel-5.13*
ubuntu/linux-oem-5.10*
ubuntu/linux-oem-5.13*
ubuntu/linux-oem-5.6*
ubuntu/linux-oracle-5.11*
ubuntu/linux-oracle-5.13*
ubuntu/linux-oracle-5.8*
ubuntu/linux-raspi2*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.11*
ubuntu/linux-riscv-5.8*
ubuntu/linux-allwinner-5.19*
ubuntu/linux-aws-5.19*
ubuntu/linux-aws-6.2*
ubuntu/linux-aws-6.5*
ubuntu/linux-aws-6.8<6.8.0-1032.34~22.04.1
6.8.0-1032.34~22.04.1
ubuntu/linux-azure-5.19*
ubuntu/linux-azure-6.2*
ubuntu/linux-azure-6.5*
ubuntu/linux-azure-6.8<6.8.0-1034.39~22.04.1
6.8.0-1034.39~22.04.1
ubuntu/linux-azure-fde-5.19*
ubuntu/linux-azure-fde-6.2*
ubuntu/linux-gcp-5.19*
ubuntu/linux-gcp-6.2*
ubuntu/linux-gcp-6.5*
ubuntu/linux-gcp-6.8<6.8.0-1033.35~22.04.1
6.8.0-1033.35~22.04.1
ubuntu/linux-hwe-5.19*
ubuntu/linux-hwe-6.2*
ubuntu/linux-hwe-6.5*
ubuntu/linux-hwe-6.8<6.8.0-64.67~22.04.1
6.8.0-64.67~22.04.1
ubuntu/linux-ibm-6.8<6.8.0-1029.29~22.04.1
6.8.0-1029.29~22.04.1
ubuntu/linux-intel-iot-realtime*
ubuntu/linux-lowlatency-hwe-5.19*
ubuntu/linux-lowlatency-hwe-6.2*
ubuntu/linux-lowlatency-hwe-6.5*
ubuntu/linux-lowlatency-hwe-6.8<6.8.0-64.67.1~22.04.1
6.8.0-64.67.1~22.04.1
ubuntu/linux-nvidia-6.2*
ubuntu/linux-nvidia-6.5*
ubuntu/linux-nvidia-6.8<6.8.0-1031.34~22.04.1
6.8.0-1031.34~22.04.1
ubuntu/linux-oem-5.17*
ubuntu/linux-oem-6.0*
ubuntu/linux-oem-6.1*
ubuntu/linux-oem-6.5*
ubuntu/linux-oracle-6.5*
ubuntu/linux-oracle-6.8<6.8.0-1029.30~22.04.1
6.8.0-1029.30~22.04.1
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.19*
ubuntu/linux-riscv-6.5*
ubuntu/linux-riscv-6.8<6.8.0-64.67~22.04.1
6.8.0-64.67~22.04.1
ubuntu/linux-starfive-5.19*
ubuntu/linux-starfive-6.2*
ubuntu/linux-starfive-6.5*
ubuntu/linux-realtime-6.8<6.8.1-1025.26~22.04.1
6.8.1-1025.26~22.04.1
ubuntu/linux<6.8.0-64.67
6.8.0-64.67
ubuntu/linux-aws<6.8.0-1032.34
6.8.0-1032.34
ubuntu/linux-azure<6.8.0-1034.39
6.8.0-1034.39
ubuntu/linux-azure-6.11<6.11.0-1015.15~24.04.1
6.11.0-1015.15~24.04.1
ubuntu/linux-azure-nvidia<6.8.0-1022.23
6.8.0-1022.23
ubuntu/linux-gcp<6.8.0-1033.35
6.8.0-1033.35
ubuntu/linux-gcp-6.11<6.11.0-1015.15~24.04.1
6.11.0-1015.15~24.04.1
ubuntu/linux-gke<6.8.0-1028.32
6.8.0-1028.32
ubuntu/linux-gkeop<6.8.0-1015.17
6.8.0-1015.17
ubuntu/linux-hwe-6.11<6.11.0-26.26~24.04.1
6.11.0-26.26~24.04.1
ubuntu/linux-ibm<6.8.0-1029.29
6.8.0-1029.29
ubuntu/linux-lowlatency<6.8.0-64.67.1
6.8.0-64.67.1
ubuntu/linux-lowlatency-hwe-6.11<6.11.0-1014.15~24.04.1
6.11.0-1014.15~24.04.1
ubuntu/linux-nvidia<6.8.0-1031.34
6.8.0-1031.34
ubuntu/linux-nvidia-6.11<6.11.0-1010.10
6.11.0-1010.10
ubuntu/linux-nvidia-lowlatency<6.8.0-1031.34.1
6.8.0-1031.34.1
ubuntu/linux-nvidia-tegra<6.8.0-1008.8
6.8.0-1008.8
ubuntu/linux-oem-6.11<6.11.0-1022.22
6.11.0-1022.22
ubuntu/linux-oem-6.8<6.8.0-1031.31
6.8.0-1031.31
ubuntu/linux-oracle<6.8.0-1029.30
6.8.0-1029.30
ubuntu/linux-raspi<6.8.0-1031.35
6.8.0-1031.35
ubuntu/linux-raspi-realtime*
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-xilinx<6.8.0-1017.18
6.8.0-1017.18
ubuntu/linux-raspi-realtime<6.8.0-2026.27
6.8.0-2026.27
ubuntu/linux-realtime<6.8.1-1025.26
6.8.1-1025.26
ubuntu/linux-fips<6.8.0-78.78+fips1
6.8.0-78.78+fips1
ubuntu/linux-vmware*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.15-1
  2. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1
  3. Upgrade

    Upgrade ubuntu/linux-aws-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1032.34~22.04.1
  4. Upgrade

    Upgrade ubuntu/linux-azure-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1034.39~22.04.1
  5. Upgrade

    Upgrade ubuntu/linux-gcp-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1033.35~22.04.1
  6. Upgrade

    Upgrade ubuntu/linux-hwe-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-64.67~22.04.1
  7. Upgrade

    Upgrade ubuntu/linux-ibm-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1029.29~22.04.1
  8. Upgrade

    Upgrade ubuntu/linux-lowlatency-hwe-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-64.67.1~22.04.1
  9. Upgrade

    Upgrade ubuntu/linux-nvidia-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1031.34~22.04.1
  10. Upgrade

    Upgrade ubuntu/linux-oracle-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1029.30~22.04.1
  11. Upgrade

    Upgrade ubuntu/linux-riscv-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-64.67~22.04.1
  12. Upgrade

    Upgrade ubuntu/linux-realtime-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.1-1025.26~22.04.1
  13. Upgrade

    Upgrade ubuntu/linux to a version that resolves this vulnerability.

    Fixed in 6.8.0-64.67
  14. Upgrade

    Upgrade ubuntu/linux-aws to a version that resolves this vulnerability.

    Fixed in 6.8.0-1032.34
  15. Upgrade

    Upgrade ubuntu/linux-azure to a version that resolves this vulnerability.

    Fixed in 6.8.0-1034.39
  16. Upgrade

    Upgrade ubuntu/linux-azure-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1015.15~24.04.1
  17. Upgrade

    Upgrade ubuntu/linux-azure-nvidia to a version that resolves this vulnerability.

    Fixed in 6.8.0-1022.23
  18. Upgrade

    Upgrade ubuntu/linux-gcp to a version that resolves this vulnerability.

    Fixed in 6.8.0-1033.35
  19. Upgrade

    Upgrade ubuntu/linux-gcp-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1015.15~24.04.1
  20. Upgrade

    Upgrade ubuntu/linux-gke to a version that resolves this vulnerability.

    Fixed in 6.8.0-1028.32
  21. Upgrade

    Upgrade ubuntu/linux-gkeop to a version that resolves this vulnerability.

    Fixed in 6.8.0-1015.17
  22. Upgrade

    Upgrade ubuntu/linux-hwe-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-26.26~24.04.1
  23. Upgrade

    Upgrade ubuntu/linux-ibm to a version that resolves this vulnerability.

    Fixed in 6.8.0-1029.29
  24. Upgrade

    Upgrade ubuntu/linux-lowlatency to a version that resolves this vulnerability.

    Fixed in 6.8.0-64.67.1
  25. Upgrade

    Upgrade ubuntu/linux-lowlatency-hwe-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1014.15~24.04.1
  26. Upgrade

    Upgrade ubuntu/linux-nvidia to a version that resolves this vulnerability.

    Fixed in 6.8.0-1031.34
  27. Upgrade

    Upgrade ubuntu/linux-nvidia-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1010.10
  28. Upgrade

    Upgrade ubuntu/linux-nvidia-lowlatency to a version that resolves this vulnerability.

    Fixed in 6.8.0-1031.34.1
  29. Upgrade

    Upgrade ubuntu/linux-nvidia-tegra to a version that resolves this vulnerability.

    Fixed in 6.8.0-1008.8
  30. Upgrade

    Upgrade ubuntu/linux-oem-6.11 to a version that resolves this vulnerability.

    Fixed in 6.11.0-1022.22
  31. Upgrade

    Upgrade ubuntu/linux-oem-6.8 to a version that resolves this vulnerability.

    Fixed in 6.8.0-1031.31
  32. Upgrade

    Upgrade ubuntu/linux-oracle to a version that resolves this vulnerability.

    Fixed in 6.8.0-1029.30
  33. Upgrade

    Upgrade ubuntu/linux-raspi to a version that resolves this vulnerability.

    Fixed in 6.8.0-1031.35
  34. Upgrade

    Upgrade ubuntu/linux-xilinx to a version that resolves this vulnerability.

    Fixed in 6.8.0-1017.18
  35. Upgrade

    Upgrade ubuntu/linux-raspi-realtime to a version that resolves this vulnerability.

    Fixed in 6.8.0-2026.27
  36. Upgrade

    Upgrade ubuntu/linux-realtime to a version that resolves this vulnerability.

    Fixed in 6.8.1-1025.26
  37. Upgrade

    Upgrade ubuntu/linux-fips to a version that resolves this vulnerability.

    Fixed in 6.8.0-78.78+fips1

Event History

Feb 27, 2025
CVE Published
via MITRE·02:12 AM
Data Sourced
via MITRE·02:12 AM
Description
Data Sourced
via OSV·03:15 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·03:15 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-58018?

CVE-2024-58018 has been rated as a medium severity vulnerability in the Linux kernel.

2

How do I fix CVE-2024-58018?

To fix CVE-2024-58018, update your Linux kernel to the latest stable version that contains the patch for this vulnerability.

3

What components are affected by CVE-2024-58018?

CVE-2024-58018 specifically affects the nvkm module within the Linux kernel.

4

What type of vulnerability is CVE-2024-58018?

CVE-2024-58018 is a command queue buffer vulnerability that can result from improper handling of large RPC requests.

5

Is CVE-2024-58018 being actively exploited?

As of now, there are no widely reported active exploits for CVE-2024-58018, but it is recommended to apply patches promptly.

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