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 2D8F71F6675 for ; Fri, 27 Dec 2024 15:07:04 +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=1735312024; cv=none; b=ive33oTS4Asbc3Hm/MO06d+FI3uARMFE30uZQ/q6w8SF7/amIq356UCWs2JJX1RBAO5GztTYgNLk05zDxGzBNwfKzuyG5YNDyFwRCiscndTbQjDHmPtM4bRRBRvDun4i3go7a+fhi6ab0m5Xj1e/Jo5KVjmE1F0fIOM2PsloWXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735312024; c=relaxed/simple; bh=XIU18+/VMnR9rQbgwDl9AwU3r2pSdQhwlRLI9pI8Fbs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mvXCBJRlMuj4BraU3yxLisWK0PYut2lBAuDURS6kUCdBujLloM2UduDonD+e+jWHFIePtkCtB2WV5nKTaUhT+0qm7CYs8WHg1gYyQSl5LrgLwOM/GZrsLMjZrUKbyJx2Br7ilMIBKwN8Dpa9iei+sVCs/Ql91PNMq14MMkBpJao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cEvbmzyr; 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="cEvbmzyr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90AE5C4CED3; Fri, 27 Dec 2024 15:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735312024; bh=XIU18+/VMnR9rQbgwDl9AwU3r2pSdQhwlRLI9pI8Fbs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=cEvbmzyrC+8w2QHvlr6tq2SwavKmeEmqNbrnZSMsn8X2uFdZWu0ybPY18H47kX1NX bVk6rlWl+b3d1mwzd0q6N+3VVKOyEG/n52TMR0gvP36Te0JxbZqz6Vk0al1WGYmuDV Q/GX5wSl2Sk7roDM+A7pQh+egILrVgGj2J/nSPRo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56652: drm/xe/reg_sr: Remove register pool Date: Fri, 27 Dec 2024 16:06:49 +0100 Message-ID: <2024122748-CVE-2024-56652-31db@gregkh> X-Mailer: git-send-email 2.47.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=2528; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=XIU18+/VMnR9rQbgwDl9AwU3r2pSdQhwlRLI9pI8Fbs=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5hzo+T/ruU/RrwxnbVimN4yUujx8/mTaBTeitos2i7 EX/1z/82xHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATibVkmO/4KT6UU1fktqeY 8rqAAwWiO/uXZDMsWCRt0nvTJJ2hT0/kw3rVR/O+uWxdAgA= 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: drm/xe/reg_sr: Remove register pool That pool implementation doesn't really work: if the krealloc happens to move the memory and return another address, the entries in the xarray become invalid, leading to use-after-free later: BUG: KASAN: slab-use-after-free in xe_reg_sr_apply_mmio+0x570/0x760 [xe] Read of size 4 at addr ffff8881244b2590 by task modprobe/2753 Allocated by task 2753: kasan_save_stack+0x39/0x70 kasan_save_track+0x14/0x40 kasan_save_alloc_info+0x37/0x60 __kasan_kmalloc+0xc3/0xd0 __kmalloc_node_track_caller_noprof+0x200/0x6d0 krealloc_noprof+0x229/0x380 Simplify the code to fix the bug. A better pooling strategy may be added back later if needed. (cherry picked from commit e5283bd4dfecbd3335f43b62a68e24dae23f59e4) The Linux kernel CVE team has assigned CVE-2024-56652 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit dd08ebf6c3525a7ea2186e636df064ea47281987 and fixed in 6.12.6 with commit b0193a31a0ca5a0f9e60bb4a86537d46b98111b8 Issue introduced in 6.8 with commit dd08ebf6c3525a7ea2186e636df064ea47281987 and fixed in 6.13-rc3 with commit d7b028656c29b22fcde1c6ee1df5b28fbba987b5 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-56652 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/gpu/drm/xe/xe_reg_sr.c drivers/gpu/drm/xe/xe_reg_sr_types.h 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/b0193a31a0ca5a0f9e60bb4a86537d46b98111b8 https://git.kernel.org/stable/c/d7b028656c29b22fcde1c6ee1df5b28fbba987b5