CVE-2022-48840
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
16/07/2024
Last modified:
17/07/2024
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
iavf: Fix hang during reboot/shutdown<br />
<br />
Recent commit 974578017fc1 ("iavf: Add waiting so the port is<br />
initialized in remove") adds a wait-loop at the beginning of<br />
iavf_remove() to ensure that port initialization is finished<br />
prior unregistering net device. This causes a regression<br />
in reboot/shutdown scenario because in this case callback<br />
iavf_shutdown() is called and this callback detaches the device,<br />
makes it down if it is running and sets its state to __IAVF_REMOVE.<br />
Later shutdown callback of associated PF driver (e.g. ice_shutdown)<br />
is called. That callback calls among other things sriov_disable()<br />
that calls indirectly iavf_remove() (see stack trace below).<br />
As the adapter state is already __IAVF_REMOVE then the mentioned<br />
loop is end-less and shutdown process hangs.<br />
<br />
The patch fixes this by checking adapter&#39;s state at the beginning<br />
of iavf_remove() and skips the rest of the function if the adapter<br />
is already in remove state (shutdown is in progress).<br />
<br />
Reproducer:<br />
1. Create VF on PF driven by ice or i40e driver<br />
2. Ensure that the VF is bound to iavf driver<br />
3. Reboot<br />
<br />
[52625.981294] sysrq: SysRq : Show Blocked State<br />
[52625.988377] task:reboot state:D stack: 0 pid:17359 ppid: 1 f2<br />
[52625.996732] Call Trace:<br />
[52625.999187] __schedule+0x2d1/0x830<br />
[52626.007400] schedule+0x35/0xa0<br />
[52626.010545] schedule_hrtimeout_range_clock+0x83/0x100<br />
[52626.020046] usleep_range+0x5b/0x80<br />
[52626.023540] iavf_remove+0x63/0x5b0 [iavf]<br />
[52626.027645] pci_device_remove+0x3b/0xc0<br />
[52626.031572] device_release_driver_internal+0x103/0x1f0<br />
[52626.036805] pci_stop_bus_device+0x72/0xa0<br />
[52626.040904] pci_stop_and_remove_bus_device+0xe/0x20<br />
[52626.045870] pci_iov_remove_virtfn+0xba/0x120<br />
[52626.050232] sriov_disable+0x2f/0xe0<br />
[52626.053813] ice_free_vfs+0x7c/0x340 [ice]<br />
[52626.057946] ice_remove+0x220/0x240 [ice]<br />
[52626.061967] ice_shutdown+0x16/0x50 [ice]<br />
[52626.065987] pci_device_shutdown+0x34/0x60<br />
[52626.070086] device_shutdown+0x165/0x1c5<br />
[52626.074011] kernel_restart+0xe/0x30<br />
[52626.077593] __do_sys_reboot+0x1d2/0x210<br />
[52626.093815] do_syscall_64+0x5b/0x1a0<br />
[52626.097483] entry_SYSCALL_64_after_hwframe+0x65/0xca
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
CPE | From | Up to |
---|---|---|
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.15.27 (including) | 5.15.31 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16.13 (including) | 5.16.17 (excluding) |
To consult the complete list of CPE names with products and versions, see this page