Vulnerability · Published Nov 19, 2024 · Assigned by Linux
CVE-2024-50296net: hns3: fix kernel crash when uninstalling driver
Medium 5.5
In plain English
A medium-severity null pointer dereference 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 17% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: net: hns3: fix kernel crash when uninstalling driver When the driver is uninstalled and the VF is disabled concurrently, a kernel crash occurs. The reason is that the two actions call function pci_disable_sriov(). The num_VFs is checked to determine whether to release the corresponding resources. During the second calling, num_VFs is not 0 and the resource release function is called. However, the corresponding resource has been released during the first invoking. Therefore, the problem occurs: [15277.839633][T50670] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020 ... [15278.131557][T50670] Call trace: [15278.134686][T50670] klist_put+0x28/0x12c [15278.138682][T50670] klist_del+0x14/0x20 [15278.142592][T50670] device_del+0xbc/0x3c0 [15278.146676][T50670] pci_remove_bus_device+0x84/0x120 [15278.151714][T50670] pci_stop_and_remove_bus_device+0x6c/0x80 [15278.157447][T50670] pci_iov_remove_virtfn+0xb4/0x12c [15278.162485][T50670] sriov_disable+0x50/0x11c [15278.166829][T50670] pci_disable_sriov+0x24/0x30 [15278.171433][T50670] hnae3_unregister_ae_algo_prepare+0x60/0x90 [hnae3] [15278.178039][T50670] hclge_exit+0x28/0xd0 [hclge] [15278.182730][T50670] __se_sys_delete_module.isra.0+0x164/0x230 [15278.188550][T50670] __arm64_sys_delete_module+0x1c/0x30 [15278.193848][T50670] invoke_syscall+0x50/0x11c [15278.198278][T50670] el0_svc_common.constprop.0+0x158/0x164 [15278.203837][T50670] do_el0_svc+0x34/0xcc [15278.207834][T50670] el0_svc+0x20/0x30 For details, see the following figure. rmmod hclge disable VFs ---------------------------------------------------- hclge_exit() sriov_numvfs_store() ... device_lock() pci_disable_sriov() hns3_pci_sriov_configure() pci_disable_sriov() sriov_disable() sriov_disable() if !num_VFs : if !num_VFs : return; return; sriov_del_vfs() sriov_del_vfs() ... ... klist_put() klist_put() ... ... num_VFs = 0; num_VFs = 0; device_unlock(); In this patch, when driver is removing, we get the device_lock() to protect num_VFs, just like sriov_numvfs_store().
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.119-1 | DEBIAN-CVE-2024-50296 |
| Debian:13 | linux | 6.11.9-1 | DEBIAN-CVE-2024-50296 |
| Debian:14 | linux | 6.11.9-1 | DEBIAN-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux | 5.15.0-133.144 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux | 6.8.0-58.60 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1078.85 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1027.29 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1027.29~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1081.90 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1027.32 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | 6.11.0-1012.12~24.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1027.32~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1081.90.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1014.15 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1077.86 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1028.30 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | 6.11.0-1011.11~24.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1028.30~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1075.81 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1023.27 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1060.68 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1010.12 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-58.60~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1070.73 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1024.24 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1024.24~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1073.79 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1076.81 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-133.143 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-58.60.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-58.60.1~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1072.73 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1026.29 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | 6.11.0-1007.7 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1026.29~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1026.29.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1033.33 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1008.8 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1021.21 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1015.15 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1026.26 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1075.81 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1024.25 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1024.25~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1072.75 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1028.32 | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-58.60.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-58.60.1~22.04.1 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-50296 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1017.18 | UBUNTU-CVE-2024-50296 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1044.48 | UBUNTU-CVE-2024-50296 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | b06ad258e01389ca3ff13bc180f3fcd6a608f1cd – before a0df055775f30850c0da8f7dab40d67c0fd63908c4b64011e458aa2b246cd4e42012cfd83d2d9a5c – before 7ae4e56de7dbd0999578246a536cf52a63f4056dd36b15e3e7b5937cb1f6ac590a85facc3a320642 – before 590a4b2d4e0b73586e88bce9b8135b593355ec090dd8a25f355b4df2d41c08df1716340854c7d4c5 – before e36482b222e00cc7aeeea772fc0cf2943590bc4d0dd8a25f355b4df2d41c08df1716340854c7d4c5 – before 76b155e14d9b182ce83d32ada2d0d7219ea8c8dd0dd8a25f355b4df2d41c08df1716340854c7d4c5 – before 719edd9f3372ce7fb3b157647c6658672946874b0dd8a25f355b4df2d41c08df1716340854c7d4c5 – before b5c94e4d947d15d521e935ff10c5a22a7883dea50dd8a25f355b4df2d41c08df1716340854c7d4c5 – before df3dff8ab6d79edc942464999d06fbaedf8cdd18 |
| Linux | Linux | 5.15 |
Weakness: CWE-476 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
References
- https://git.kernel.org/stable/c/a0df055775f30850c0da8f7dab40d67c0fd63908
- https://git.kernel.org/stable/c/7ae4e56de7dbd0999578246a536cf52a63f4056d
- https://git.kernel.org/stable/c/590a4b2d4e0b73586e88bce9b8135b593355ec09
- https://git.kernel.org/stable/c/e36482b222e00cc7aeeea772fc0cf2943590bc4d
- https://git.kernel.org/stable/c/76b155e14d9b182ce83d32ada2d0d7219ea8c8dd
- https://git.kernel.org/stable/c/719edd9f3372ce7fb3b157647c6658672946874b
- https://git.kernel.org/stable/c/b5c94e4d947d15d521e935ff10c5a22a7883dea5
- https://git.kernel.org/stable/c/df3dff8ab6d79edc942464999d06fbaedf8cdd18
- https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html