cve-2022-48840
Vulnerability from cvelistv5
Published
2024-07-16 12:25
Modified
2024-12-19 08:08
Severity ?
EPSS score ?
Summary
iavf: Fix hang during reboot/shutdown
References
{ "containers": { "adp": [ { "providerMetadata": { "dateUpdated": "2024-08-03T15:25:01.614Z", "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE" }, "references": [ { "tags": [ "x_transferred" ], "url": "https://git.kernel.org/stable/c/80974bb730270199c6fcb189af04d5945b87e813" }, { "tags": [ "x_transferred" ], "url": "https://git.kernel.org/stable/c/4477b9a4193b35eb3a8afd2adf2d42add2f88d57" }, { "tags": [ "x_transferred" ], "url": "https://git.kernel.org/stable/c/b04683ff8f0823b869c219c78ba0d974bddea0b5" } ], "title": "CVE Program Container" }, { "metrics": [ { "other": { "content": { "id": "CVE-2022-48840", "options": [ { "Exploitation": "none" }, { "Automatable": "no" }, { "Technical Impact": "partial" } ], "role": "CISA Coordinator", "timestamp": "2024-09-10T16:56:57.340202Z", "version": "2.0.3" }, "type": "ssvc" } } ], "providerMetadata": { "dateUpdated": "2024-09-11T17:34:09.921Z", "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "shortName": "CISA-ADP" }, "title": "CISA ADP Vulnrichment" } ], "cna": { "affected": [ { "defaultStatus": "unaffected", "product": "Linux", "programFiles": [ "drivers/net/ethernet/intel/iavf/iavf_main.c" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "lessThan": "80974bb730270199c6fcb189af04d5945b87e813", "status": "affected", "version": "85aa76066fef64de8a48d0da6b4071ceac455a94", "versionType": "git" }, { "lessThan": "4477b9a4193b35eb3a8afd2adf2d42add2f88d57", "status": "affected", "version": "7b9515172ab4d4c6ac0eae4b71013ee6ce932205", "versionType": "git" }, { "lessThan": "b04683ff8f0823b869c219c78ba0d974bddea0b5", "status": "affected", "version": "974578017fc1fdd06cea8afb9dfa32602e8529ed", "versionType": "git" } ] }, { "defaultStatus": "unaffected", "product": "Linux", "programFiles": [ "drivers/net/ethernet/intel/iavf/iavf_main.c" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "lessThan": "5.15.31", "status": "affected", "version": "5.15.27", "versionType": "semver" }, { "lessThan": "5.16.17", "status": "affected", "version": "5.16.13", "versionType": "semver" } ] } ], "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\niavf: Fix hang during reboot/shutdown\n\nRecent commit 974578017fc1 (\"iavf: Add waiting so the port is\ninitialized in remove\") adds a wait-loop at the beginning of\niavf_remove() to ensure that port initialization is finished\nprior unregistering net device. This causes a regression\nin reboot/shutdown scenario because in this case callback\niavf_shutdown() is called and this callback detaches the device,\nmakes it down if it is running and sets its state to __IAVF_REMOVE.\nLater shutdown callback of associated PF driver (e.g. ice_shutdown)\nis called. That callback calls among other things sriov_disable()\nthat calls indirectly iavf_remove() (see stack trace below).\nAs the adapter state is already __IAVF_REMOVE then the mentioned\nloop is end-less and shutdown process hangs.\n\nThe patch fixes this by checking adapter\u0027s state at the beginning\nof iavf_remove() and skips the rest of the function if the adapter\nis already in remove state (shutdown is in progress).\n\nReproducer:\n1. Create VF on PF driven by ice or i40e driver\n2. Ensure that the VF is bound to iavf driver\n3. Reboot\n\n[52625.981294] sysrq: SysRq : Show Blocked State\n[52625.988377] task:reboot state:D stack: 0 pid:17359 ppid: 1 f2\n[52625.996732] Call Trace:\n[52625.999187] __schedule+0x2d1/0x830\n[52626.007400] schedule+0x35/0xa0\n[52626.010545] schedule_hrtimeout_range_clock+0x83/0x100\n[52626.020046] usleep_range+0x5b/0x80\n[52626.023540] iavf_remove+0x63/0x5b0 [iavf]\n[52626.027645] pci_device_remove+0x3b/0xc0\n[52626.031572] device_release_driver_internal+0x103/0x1f0\n[52626.036805] pci_stop_bus_device+0x72/0xa0\n[52626.040904] pci_stop_and_remove_bus_device+0xe/0x20\n[52626.045870] pci_iov_remove_virtfn+0xba/0x120\n[52626.050232] sriov_disable+0x2f/0xe0\n[52626.053813] ice_free_vfs+0x7c/0x340 [ice]\n[52626.057946] ice_remove+0x220/0x240 [ice]\n[52626.061967] ice_shutdown+0x16/0x50 [ice]\n[52626.065987] pci_device_shutdown+0x34/0x60\n[52626.070086] device_shutdown+0x165/0x1c5\n[52626.074011] kernel_restart+0xe/0x30\n[52626.077593] __do_sys_reboot+0x1d2/0x210\n[52626.093815] do_syscall_64+0x5b/0x1a0\n[52626.097483] entry_SYSCALL_64_after_hwframe+0x65/0xca" } ], "providerMetadata": { "dateUpdated": "2024-12-19T08:08:44.698Z", "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux" }, "references": [ { "url": "https://git.kernel.org/stable/c/80974bb730270199c6fcb189af04d5945b87e813" }, { "url": "https://git.kernel.org/stable/c/4477b9a4193b35eb3a8afd2adf2d42add2f88d57" }, { "url": "https://git.kernel.org/stable/c/b04683ff8f0823b869c219c78ba0d974bddea0b5" } ], "title": "iavf: Fix hang during reboot/shutdown", "x_generator": { "engine": "bippy-5f407fcff5a0" } } }, "cveMetadata": { "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "assignerShortName": "Linux", "cveId": "CVE-2022-48840", "datePublished": "2024-07-16T12:25:11.173Z", "dateReserved": "2024-07-16T11:38:08.909Z", "dateUpdated": "2024-12-19T08:08:44.698Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1", "meta": { "nvd": "{\"cve\":{\"id\":\"CVE-2022-48840\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-07-16T13:15:11.440\",\"lastModified\":\"2024-07-17T20:37:49.917\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\niavf: Fix hang during reboot/shutdown\\n\\nRecent commit 974578017fc1 (\\\"iavf: Add waiting so the port is\\ninitialized in remove\\\") adds a wait-loop at the beginning of\\niavf_remove() to ensure that port initialization is finished\\nprior unregistering net device. This causes a regression\\nin reboot/shutdown scenario because in this case callback\\niavf_shutdown() is called and this callback detaches the device,\\nmakes it down if it is running and sets its state to __IAVF_REMOVE.\\nLater shutdown callback of associated PF driver (e.g. ice_shutdown)\\nis called. That callback calls among other things sriov_disable()\\nthat calls indirectly iavf_remove() (see stack trace below).\\nAs the adapter state is already __IAVF_REMOVE then the mentioned\\nloop is end-less and shutdown process hangs.\\n\\nThe patch fixes this by checking adapter\u0027s state at the beginning\\nof iavf_remove() and skips the rest of the function if the adapter\\nis already in remove state (shutdown is in progress).\\n\\nReproducer:\\n1. Create VF on PF driven by ice or i40e driver\\n2. Ensure that the VF is bound to iavf driver\\n3. Reboot\\n\\n[52625.981294] sysrq: SysRq : Show Blocked State\\n[52625.988377] task:reboot state:D stack: 0 pid:17359 ppid: 1 f2\\n[52625.996732] Call Trace:\\n[52625.999187] __schedule+0x2d1/0x830\\n[52626.007400] schedule+0x35/0xa0\\n[52626.010545] schedule_hrtimeout_range_clock+0x83/0x100\\n[52626.020046] usleep_range+0x5b/0x80\\n[52626.023540] iavf_remove+0x63/0x5b0 [iavf]\\n[52626.027645] pci_device_remove+0x3b/0xc0\\n[52626.031572] device_release_driver_internal+0x103/0x1f0\\n[52626.036805] pci_stop_bus_device+0x72/0xa0\\n[52626.040904] pci_stop_and_remove_bus_device+0xe/0x20\\n[52626.045870] pci_iov_remove_virtfn+0xba/0x120\\n[52626.050232] sriov_disable+0x2f/0xe0\\n[52626.053813] ice_free_vfs+0x7c/0x340 [ice]\\n[52626.057946] ice_remove+0x220/0x240 [ice]\\n[52626.061967] ice_shutdown+0x16/0x50 [ice]\\n[52626.065987] pci_device_shutdown+0x34/0x60\\n[52626.070086] device_shutdown+0x165/0x1c5\\n[52626.074011] kernel_restart+0xe/0x30\\n[52626.077593] __do_sys_reboot+0x1d2/0x210\\n[52626.093815] do_syscall_64+0x5b/0x1a0\\n[52626.097483] entry_SYSCALL_64_after_hwframe+0x65/0xca\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se resolvi\u00f3 la siguiente vulnerabilidad: iavf: corrige el bloqueo durante el reinicio/apagado. El commit reciente 974578017fc1 (\\\"iavf: agrega espera para que el puerto se inicialice en eliminar\\\") agrega un bucle de espera al comienzo de iavf_remove() para garantizar que la inicializaci\u00f3n del puerto finalice antes de cancelar el registro del dispositivo de red. Esto provoca una regresi\u00f3n en el escenario de reinicio/apagado porque en este caso se llama a la devoluci\u00f3n de llamada iavf_shutdown() y esta devoluci\u00f3n de llamada desconecta el dispositivo, lo desactiva si se est\u00e1 ejecutando y establece su estado en __IAVF_REMOVE. Posteriormente se llama a la devoluci\u00f3n de llamada de apagado del controlador PF asociado (por ejemplo, ice_shutdown). Esa devoluci\u00f3n de llamada llama, entre otras cosas, a sriov_disable() que llama indirectamente a iavf_remove() (consulte el seguimiento de la pila a continuaci\u00f3n). Como el estado del adaptador ya es __IAVF_REMOVE, el bucle mencionado no tiene fin y el proceso de apagado se bloquea. El parche soluciona este problema verificando el estado del adaptador al comienzo de iavf_remove() y omite el resto de la funci\u00f3n si el adaptador ya est\u00e1 en estado de eliminaci\u00f3n (el apagado est\u00e1 en curso). Reproductor: 1. Cree VF en PF controlado por el controlador ice o i40e 2. Aseg\u00farese de que el VF est\u00e9 vinculado al controlador iavf 3. Reinicie [52625.981294] sysrq: SysRq: Mostrar estado bloqueado [52625.988377] tarea: estado de reinicio: pila D: 0 pid:17359 ppid: 1 f2 [52625.996732] Seguimiento de llamadas: [52625.999187] __schedule+0x2d1/0x830 [52626.007400] Schedule+0x35/0xa0 [52626.010545] Schedule_hrtimeout_range_clock+0x83/0x100 2626.020046] usleep_range+0x5b/0x80 [52626.023540] iavf_remove+ 0x63/0x5b0 [iavf] [52626.027645] pci_device_remove+0x3b/0xc0 [52626.031572] device_release_driver_internal+0x103/0x1f0 [52626.036805] pci_stop_bus_device+0x72/0xa0 [52626. 040904] pci_stop_and_remove_bus_device+0xe/0x20 [52626.045870] pci_iov_remove_virtfn+0xba/0x120 [52626.050232] sriov_disable +0x2f/0xe0 [52626.053813] ice_free_vfs+0x7c/0x340 [hielo] [52626.057946] ice_remove+0x220/0x240 [hielo] [52626.061967] ice_shutdown+0x16/0x50 [52626.06598 7] pci_device_shutdown+0x34/0x60 [52626.070086] dispositivo_shutdown+ 0x165/0x1c5 [52626.074011] kernel_restart+0xe/0x30 [52626.077593] __do_sys_reboot+0x1d2/0x210 [52626.093815] do_syscall_64+0x5b/0x1a0 [52626.097483] entrada_SYSCALL_64_after_hwframe+0x65/0xca\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-835\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.15.27\",\"versionEndExcluding\":\"5.15.31\",\"matchCriteriaId\":\"59ADEA44-6FD6-4143-935C-589063ECD0F7\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.16.13\",\"versionEndExcluding\":\"5.16.17\",\"matchCriteriaId\":\"5D2EF59B-7388-4E29-B481-4F3B3CF4A802\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/4477b9a4193b35eb3a8afd2adf2d42add2f88d57\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Mailing List\",\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/80974bb730270199c6fcb189af04d5945b87e813\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Mailing List\",\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/b04683ff8f0823b869c219c78ba0d974bddea0b5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Mailing List\",\"Patch\"]}]}}" } }
Loading...
Loading...
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.