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 E53F414A8E for ; Tue, 21 May 2024 15:07:11 +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=1716304032; cv=none; b=g0dGK4MhQiLvPLGnOSefyAkGCBGcAgxwVqg5qmsaT5YFL8G5rr3mtgKbwHEatlvovbwO5fs4mVGMMSa0mFx7b6WPWdOLqvm7N18WB7M1jY92pc90VZ8q+0mddVTKR0g/fhTOoaCpYBO/wCs2NZu1Y6hIGkDCBH5sAMYCQTWEQ9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716304032; c=relaxed/simple; bh=5UnqMssy0DpG0PKnHmY5NZ+QveaQkTXYx5cTHDcmR+k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mFE5AOzxQNKeu7Q/fGAYWOWaFfQStBlC7NSfD4yhWsb5GRY5FV10ZChQXwo5W2dEjIRB62H/4a32pkgYLnwW0VR1Zdo8y/BfQb9BcTkOY+y7+xEjTo6cwN10Ew0TIZNZP/q+TovTwk8JC1n6DdjiMfF39FoEnik+55J0wmNIWpg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yvUxzzBr; 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="yvUxzzBr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EDB5C2BD11; Tue, 21 May 2024 15:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716304031; bh=5UnqMssy0DpG0PKnHmY5NZ+QveaQkTXYx5cTHDcmR+k=; h=From:To:Cc:Subject:Date:Reply-to:From; b=yvUxzzBrKeCgJ7xutLI6SM9MLUwjPxyPDhxSKldejP73j8Qm3Wsf9s2Z2G5CTF+wG W4cZZZZuNF8mXUS1aXJxJqgKDg+bkeLgqlI3aFOdRfbJLUlPB9NHJPdAvCME3Q0VUr zAFqlOC7qaHg1u9jRI3q14snX/E98ltWj4Z/G9o4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47424: i40e: Fix freeing of uninitialized misc IRQ vector Date: Tue, 21 May 2024 17:04:41 +0200 Message-ID: <2024052156-CVE-2021-47424-a4dc@gregkh> X-Mailer: git-send-email 2.45.1 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=3757; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=5UnqMssy0DpG0PKnHmY5NZ+QveaQkTXYx5cTHDcmR+k=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk+2+8kuCSW5aceqI57/P6qVHbc3+dfbfwSF77veV7lf /ODW4lKRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzk9UuG+ZG7LN4kR6m/W3ox 55sgW37oH0G1LwwLLsfFKdxxvPjAKyX9uemv/LaTx+suAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: i40e: Fix freeing of uninitialized misc IRQ vector When VSI set up failed in i40e_probe() as part of PF switch set up driver was trying to free misc IRQ vectors in i40e_clear_interrupt_scheme and produced a kernel Oops: Trying to free already-free IRQ 266 WARNING: CPU: 0 PID: 5 at kernel/irq/manage.c:1731 __free_irq+0x9a/0x300 Workqueue: events work_for_cpu_fn RIP: 0010:__free_irq+0x9a/0x300 Call Trace: ? synchronize_irq+0x3a/0xa0 free_irq+0x2e/0x60 i40e_clear_interrupt_scheme+0x53/0x190 [i40e] i40e_probe.part.108+0x134b/0x1a40 [i40e] ? kmem_cache_alloc+0x158/0x1c0 ? acpi_ut_update_ref_count.part.1+0x8e/0x345 ? acpi_ut_update_object_reference+0x15e/0x1e2 ? strstr+0x21/0x70 ? irq_get_irq_data+0xa/0x20 ? mp_check_pin_attr+0x13/0xc0 ? irq_get_irq_data+0xa/0x20 ? mp_map_pin_to_irq+0xd3/0x2f0 ? acpi_register_gsi_ioapic+0x93/0x170 ? pci_conf1_read+0xa4/0x100 ? pci_bus_read_config_word+0x49/0x70 ? do_pci_enable_device+0xcc/0x100 local_pci_probe+0x41/0x90 work_for_cpu_fn+0x16/0x20 process_one_work+0x1a7/0x360 worker_thread+0x1cf/0x390 ? create_worker+0x1a0/0x1a0 kthread+0x112/0x130 ? kthread_flush_work_fn+0x10/0x10 ret_from_fork+0x1f/0x40 The problem is that at that point misc IRQ vectors were not allocated yet and we get a call trace that driver is trying to free already free IRQ vectors. Add a check in i40e_clear_interrupt_scheme for __I40E_MISC_IRQ_REQUESTED PF state before calling i40e_free_misc_vector. This state is set only if misc IRQ vectors were properly initialized. The Linux kernel CVE team has assigned CVE-2021-47424 to this issue. Affected and fixed versions =========================== Issue introduced in 4.15 with commit c17401a1dd21 and fixed in 4.19.211 with commit 60ad4cde0ad2 Issue introduced in 4.15 with commit c17401a1dd21 and fixed in 5.4.153 with commit 17063cac4088 Issue introduced in 4.15 with commit c17401a1dd21 and fixed in 5.10.73 with commit 97aeed72af4f Issue introduced in 4.15 with commit c17401a1dd21 and fixed in 5.14.12 with commit 75099439209d Issue introduced in 4.15 with commit c17401a1dd21 and fixed in 5.15 with commit 2e5a20573a92 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-2021-47424 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/i40e/i40e_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/60ad4cde0ad28921f9ea25b0201c774b95ffa4b4 https://git.kernel.org/stable/c/17063cac4088b8e2fc0f633abddca5426ed58312 https://git.kernel.org/stable/c/97aeed72af4f83ae51534f0a2473ff52f8d66236 https://git.kernel.org/stable/c/75099439209d3cda439a1d9b00d19a50f0066fef https://git.kernel.org/stable/c/2e5a20573a926302b233b0c2e1077f5debc7ab2e