Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8505728982E for ; Wed, 18 Jun 2025 11:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244843; cv=none; b=dQ+8DjRKTXZiUiDWC2/N2nbDgWzIAMfPLP1PX8AcAjY/r5gECO/lYN+62oE0Zx4Kj2xwUnOq6eA8toNEQQUIubHhVskKog2IbPq43tkCoKewoeEiNPlWvCZ2t6Sq76RleXeafEW57+olmv9KXbyUHnZhofuy3stpnvIibR1Vhcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244843; c=relaxed/simple; bh=mERcjL8odMZ70uzE3j/JmX/P6g8y65FC8dyqBy14+8g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FX47d4hDwXe7ad7/KiFdMuizfqCYE3rbEo1Lfwm5CzQQWKctEsb3qZnXGhLui1Wru6XigEJAIRMCjEey1djb+zOiKCau/4WiLXoBPrrrM7yBg0T2Tq8hUiFxzO93bG7bvwVItV7axDQMB+MbbjOKzwDqlTgeH55K5dQe5GaN9pE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=q7me1/Ku; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="q7me1/Ku" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0A3AC4CEE7; Wed, 18 Jun 2025 11:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244843; bh=mERcjL8odMZ70uzE3j/JmX/P6g8y65FC8dyqBy14+8g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=q7me1/KuE+AvCCZupwbb/9aRIDYIMiryF5k1gKELWxVp3/W6JsBte8UnvFkjHqfbJ uGkSb6MZ7gWcQTbFWnWLXQ3HYew7x7TqIlWiaFX4kVH4WFInxmeOdKn/JXSFSLPyyk cG9u5cMhtw0LvwBzVD0gRlNW/pPbNhqvLUm9dGHA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50053: iavf: Fix reset error handling Date: Wed, 18 Jun 2025 13:01:58 +0200 Message-ID: <2025061847-CVE-2022-50053-9359@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=5259; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ohKctZkRGjm00jJAtuPVfnIB6jQTLaUmT8AJ974jidI=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc+JFY3qt161cdTZLTH3jeZ5lJV/9//S5bw+dF/ft3 YWCiVoTOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiJwwYFqx+fitkj6VbVNr1 pfNncQirRSYd/c2wYKIOX03130lr1jFKTV8XoDpNvvyZBQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: iavf: Fix reset error handling Do not call iavf_close in iavf_reset_task error handling. Doing so can lead to double call of napi_disable, which can lead to deadlock there. Removing VF would lead to iavf_remove task being stuck, because it requires crit_lock, which is held by iavf_close. Call iavf_disable_vf if reset fail, so that driver will clean up remaining invalid resources. During rapid VF resets, HW can fail to setup VF mailbox. Wrong error handling can lead to iavf_remove being stuck with: [ 5218.999087] iavf 0000:82:01.0: Failed to init adminq: -53 ... [ 5267.189211] INFO: task repro.sh:11219 blocked for more than 30 seconds. [ 5267.189520] Tainted: G S E 5.18.0-04958-ga54ce3703613-dirty #1 [ 5267.189764] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 5267.190062] task:repro.sh state:D stack: 0 pid:11219 ppid: 8162 flags:0x00000000 [ 5267.190347] Call Trace: [ 5267.190647] [ 5267.190927] __schedule+0x460/0x9f0 [ 5267.191264] schedule+0x44/0xb0 [ 5267.191563] schedule_preempt_disabled+0x14/0x20 [ 5267.191890] __mutex_lock.isra.12+0x6e3/0xac0 [ 5267.192237] ? iavf_remove+0xf9/0x6c0 [iavf] [ 5267.192565] iavf_remove+0x12a/0x6c0 [iavf] [ 5267.192911] ? _raw_spin_unlock_irqrestore+0x1e/0x40 [ 5267.193285] pci_device_remove+0x36/0xb0 [ 5267.193619] device_release_driver_internal+0xc1/0x150 [ 5267.193974] pci_stop_bus_device+0x69/0x90 [ 5267.194361] pci_stop_and_remove_bus_device+0xe/0x20 [ 5267.194735] pci_iov_remove_virtfn+0xba/0x120 [ 5267.195130] sriov_disable+0x2f/0xe0 [ 5267.195506] ice_free_vfs+0x7d/0x2f0 [ice] [ 5267.196056] ? pci_get_device+0x4f/0x70 [ 5267.196496] ice_sriov_configure+0x78/0x1a0 [ice] [ 5267.196995] sriov_numvfs_store+0xfe/0x140 [ 5267.197466] kernfs_fop_write_iter+0x12e/0x1c0 [ 5267.197918] new_sync_write+0x10c/0x190 [ 5267.198404] vfs_write+0x24e/0x2d0 [ 5267.198886] ksys_write+0x5c/0xd0 [ 5267.199367] do_syscall_64+0x3a/0x80 [ 5267.199827] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 5267.200317] RIP: 0033:0x7f5b381205c8 [ 5267.200814] RSP: 002b:00007fff8c7e8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 5267.201981] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f5b381205c8 [ 5267.202620] RDX: 0000000000000002 RSI: 00005569420ee900 RDI: 0000000000000001 [ 5267.203426] RBP: 00005569420ee900 R08: 000000000000000a R09: 00007f5b38180820 [ 5267.204327] R10: 000000000000000a R11: 0000000000000246 R12: 00007f5b383c06e0 [ 5267.205193] R13: 0000000000000002 R14: 00007f5b383bb880 R15: 0000000000000002 [ 5267.206041] [ 5267.206970] Kernel panic - not syncing: hung_task: blocked tasks [ 5267.207809] CPU: 48 PID: 551 Comm: khungtaskd Kdump: loaded Tainted: G S E 5.18.0-04958-ga54ce3703613-dirty #1 [ 5267.208726] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.11.0 11/02/2019 [ 5267.209623] Call Trace: [ 5267.210569] [ 5267.211480] dump_stack_lvl+0x33/0x42 [ 5267.212472] panic+0x107/0x294 [ 5267.213467] watchdog.cold.8+0xc/0xbb [ 5267.214413] ? proc_dohung_task_timeout_secs+0x30/0x30 [ 5267.215511] kthread+0xf4/0x120 [ 5267.216459] ? kthread_complete_and_exit+0x20/0x20 [ 5267.217505] ret_from_fork+0x22/0x30 [ 5267.218459] The Linux kernel CVE team has assigned CVE-2022-50053 to this issue. Affected and fixed versions =========================== Issue introduced in 4.14 with commit f0db78928783f0a4cce4940e8c03c2e9a760e629 and fixed in 5.15.63 with commit 743dc4377bbac06a6fe44c3c5baf75a49439678a Issue introduced in 4.14 with commit f0db78928783f0a4cce4940e8c03c2e9a760e629 and fixed in 5.19.4 with commit 0828e27971f18ea317710acb228afe6e72606082 Issue introduced in 4.14 with commit f0db78928783f0a4cce4940e8c03c2e9a760e629 and fixed in 6.0 with commit 31071173771e079f7bc08dacd61e0db913262fbf Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50053 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/ethernet/intel/iavf/iavf_main.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/743dc4377bbac06a6fe44c3c5baf75a49439678a https://git.kernel.org/stable/c/0828e27971f18ea317710acb228afe6e72606082 https://git.kernel.org/stable/c/31071173771e079f7bc08dacd61e0db913262fbf