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 593C716B388 for ; Tue, 25 Jun 2024 14:23:17 +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=1719325397; cv=none; b=vC42mtW2Lh9IMqQFxtj3bZ69TQm6m7rNd3uHvuK2oZ7ew5XoDq9JAfrqRse8jZBAjZL/7AyC/eAIklpHVW+V9iRKZrlv7AKPMIQIHn73+kuR2nG8AmlMEgISBxFSLz6QTs+BDWi9D3F84QFs8LClUUqP5M9fHOxamnVV3u20wNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719325397; c=relaxed/simple; bh=Y6u02qi+kiDIjJXvrqZ4OfdWTWoRVAUKSRprZ5vxiAk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WXs2pqBtzv7wfW0EihcWikM7mm+ZrYV+UqD+teAowYbBqubEvy7s0Di3u5Lfuo/Lhl1WsGlW5hRwcfNidO30VtIbBHKVljdEHugBJIRBvLUOOUewqgUFt1dBiJ2hCWJdg+H3ZYsZarqdkfAo5jgBc/cVLK5SkJ3C0k2lNJK+HTM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GTOzZkHV; 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="GTOzZkHV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C349FC32781; Tue, 25 Jun 2024 14:23:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719325397; bh=Y6u02qi+kiDIjJXvrqZ4OfdWTWoRVAUKSRprZ5vxiAk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=GTOzZkHV8dG6kKTITBHWdF7x4KQ/Td9YFym2PhfOcX4FD9Pwjn5CIiKmqFUDSGfri EiE1LN4eICoueknqeUdcPpImjlwKiMifvyoynvgGgLOIChvHZYNUZ1/YiPMiUtIiKw eT1yp0F/Ec4aqQ0b2emH3xg+vXv/iCwdrcIN+bRQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-38385: genirq/irqdesc: Prevent use-after-free in irq_find_at_or_after() Date: Tue, 25 Jun 2024 16:22:51 +0200 Message-ID: <2024062548-CVE-2024-38385-4b3a@gregkh> X-Mailer: git-send-email 2.45.2 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=2736; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Y6u02qi+kiDIjJXvrqZ4OfdWTWoRVAUKSRprZ5vxiAk=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlVl3ZUHSh09A/iT80081pswd7fvXXnrIo1N2K+KS3rP aEoMuNTRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExEYz7DglOHNvc/1TcwOjKJ YdZTrurgc/nTvzAs2Op9cpGFw/q2mze2isz8oV+4lLkgCQA= 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: genirq/irqdesc: Prevent use-after-free in irq_find_at_or_after() irq_find_at_or_after() dereferences the interrupt descriptor which is returned by mt_find() while neither holding sparse_irq_lock nor RCU read lock, which means the descriptor can be freed between mt_find() and the dereference: CPU0 CPU1 desc = mt_find() delayed_free_desc(desc) irq_desc_get_irq(desc) The use-after-free is reported by KASAN: Call trace: irq_get_next_irq+0x58/0x84 show_stat+0x638/0x824 seq_read_iter+0x158/0x4ec proc_reg_read_iter+0x94/0x12c vfs_read+0x1e0/0x2c8 Freed by task 4471: slab_free_freelist_hook+0x174/0x1e0 __kmem_cache_free+0xa4/0x1dc kfree+0x64/0x128 irq_kobj_release+0x28/0x3c kobject_put+0xcc/0x1e0 delayed_free_desc+0x14/0x2c rcu_do_batch+0x214/0x720 Guard the access with a RCU read lock section. The Linux kernel CVE team has assigned CVE-2024-38385 to this issue. Affected and fixed versions =========================== Issue introduced in 6.5 with commit 721255b9826b and fixed in 6.6.34 with commit 1c7891812d85 Issue introduced in 6.5 with commit 721255b9826b and fixed in 6.9.5 with commit d084aa022f84 Issue introduced in 6.5 with commit 721255b9826b and fixed in 6.10-rc1 with commit b84a8aba8062 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-38385 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: kernel/irq/irqdesc.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/1c7891812d85500ae2ca4051fa5683fcf29930d8 https://git.kernel.org/stable/c/d084aa022f84319f8079e30882cbcbc026af9f21 https://git.kernel.org/stable/c/b84a8aba806261d2f759ccedf4a2a6a80a5e55ba