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 6807413C3EB for ; Wed, 17 Apr 2024 10:30: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=1713349811; cv=none; b=t1RwpxT46pIkTa8Kz/lOAwH8eaWyYo8O1O+33UYKVkDPvsTeYXCbLSsCRW615ETztMybSH79nacq2HgbsQI294Zby9lWvccKcKP+goOcf2IB/XCz9Uii8b0CYbSyOBnQqmJbCaGkDuTj935cnAgzJCJBha1IBq+EPk+fhqSdJpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713349811; c=relaxed/simple; bh=oOrtoQeT8/mttm1ZHpU1mScPVgl7ty2Rh9XsqAnov5U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kaM4/alnkGPwEBTUyw2qprhiSCY9iY+52Ru1KzjKWbFiWP1cp7K7/ICs0ZuxbKF8YFFds5tXWon1enrSoFrfJKj1hIo9ItLbcTirlefuBsWP0TZbjzKxg7o9+JOp1/7A9j10CnkI2BLOodplVqiP6xvxw/Qo6n0vuuaDKZaLlHE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=I/XoGM8U; 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="I/XoGM8U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1C0BC072AA; Wed, 17 Apr 2024 10:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713349811; bh=oOrtoQeT8/mttm1ZHpU1mScPVgl7ty2Rh9XsqAnov5U=; h=From:To:Cc:Subject:Date:Reply-to:From; b=I/XoGM8Ubmt+rpG3N/+kQTfy0/oNHdAx0K6gukhQ57sbsj/YqMfo83hAs8+T2FlK9 TSujcf+u5zpPE2pAYjpL7hTu4T0DlWH46a7gP6Ltq9VRXJY2j5t/hsZzRZG/tsJaYo 6YzrDhUEq1cE4MPpGMPORGVWCx8eKi6zLnfWwGj8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26892: wifi: mt76: mt7921e: fix use-after-free in free_irq() Date: Wed, 17 Apr 2024 12:29:07 +0200 Message-ID: <2024041743-CVE-2024-26892-809e@gregkh> X-Mailer: git-send-email 2.44.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=3868; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oOrtoQeT8/mttm1ZHpU1mScPVgl7ty2Rh9XsqAnov5U=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnyS6JTxQJfT7dzSIn5KhFj1SSVfuHvDbm7PzSfZO2fw 2LY++B3RywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzk6waGBTdrFj08GTz5ogD3 29zFz9K0I/ITwhgWLJngnNv5v/Sn82zzuPjcwP1/17uaAgA= 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: wifi: mt76: mt7921e: fix use-after-free in free_irq() >From commit a304e1b82808 ("[PATCH] Debug shared irqs"), there is a test to make sure the shared irq handler should be able to handle the unexpected event after deregistration. For this case, let's apply MT76_REMOVED flag to indicate the device was removed and do not run into the resource access anymore. BUG: KASAN: use-after-free in mt7921_irq_handler+0xd8/0x100 [mt7921e] Read of size 8 at addr ffff88824a7d3b78 by task rmmod/11115 CPU: 28 PID: 11115 Comm: rmmod Tainted: G W L 5.17.0 #10 Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I EDGE WIFI (MS-7D73), BIOS 1.81 01/05/2024 Call Trace: dump_stack_lvl+0x6f/0xa0 print_address_description.constprop.0+0x1f/0x190 ? mt7921_irq_handler+0xd8/0x100 [mt7921e] ? mt7921_irq_handler+0xd8/0x100 [mt7921e] kasan_report.cold+0x7f/0x11b ? mt7921_irq_handler+0xd8/0x100 [mt7921e] mt7921_irq_handler+0xd8/0x100 [mt7921e] free_irq+0x627/0xaa0 devm_free_irq+0x94/0xd0 ? devm_request_any_context_irq+0x160/0x160 ? kobject_put+0x18d/0x4a0 mt7921_pci_remove+0x153/0x190 [mt7921e] pci_device_remove+0xa2/0x1d0 __device_release_driver+0x346/0x6e0 driver_detach+0x1ef/0x2c0 bus_remove_driver+0xe7/0x2d0 ? __check_object_size+0x57/0x310 pci_unregister_driver+0x26/0x250 __do_sys_delete_module+0x307/0x510 ? free_module+0x6a0/0x6a0 ? fpregs_assert_state_consistent+0x4b/0xb0 ? rcu_read_lock_sched_held+0x10/0x70 ? syscall_enter_from_user_mode+0x20/0x70 ? trace_hardirqs_on+0x1c/0x130 do_syscall_64+0x5c/0x80 ? trace_hardirqs_on_prepare+0x72/0x160 ? do_syscall_64+0x68/0x80 ? trace_hardirqs_on_prepare+0x72/0x160 entry_SYSCALL_64_after_hwframe+0x44/0xae The Linux kernel CVE team has assigned CVE-2024-26892 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit 9270270d6219 and fixed in 6.6.23 with commit c7dd42fbebcf Issue introduced in 6.4 with commit 9270270d6219 and fixed in 6.7.11 with commit bfe1adf1606f Issue introduced in 6.4 with commit 9270270d6219 and fixed in 6.8.2 with commit bfeaef901194 Issue introduced in 6.4 with commit 9270270d6219 and fixed in 6.9-rc1 with commit c957280ef6ab Issue introduced in 6.2.15 with commit a76eaaaafd8b Issue introduced in 6.3.2 with commit 95e41ac30a0d 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-2024-26892 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/wireless/mediatek/mt76/mt7921/pci.c drivers/net/wireless/mediatek/mt76/mt792x_dma.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/c7dd42fbebcfb02bef070fd48f774d6412d0b49d https://git.kernel.org/stable/c/bfe1adf1606f76c180324e53b130f0e76d5cc6c3 https://git.kernel.org/stable/c/bfeaef901194c5923ce3330272786eff2fac513a https://git.kernel.org/stable/c/c957280ef6ab6bdf559a91ae693a6b34310697e3