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 601201D2F50 for ; Tue, 19 Nov 2024 17:24:15 +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=1732037055; cv=none; b=nxD6/yYixrAUAPMKhjojeonxBkl6F/ItF5bQv3Iya5iiJQhBv/OqjUbcMRQUkB+verXKBosGwNe3FdJSPne0jnOulPwJIFcqklokDV81W5lP+ELNP71geG+UcbPibkUt9tuJBVF0XjXjhBey6NU7bKWQG+7idxi/XFXu5sgDSHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732037055; c=relaxed/simple; bh=qDJ+jFJs2nrMmgiAKvoyISCBFEAte5tiI1Hy68/otTA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=acORw6A3Ab/RAFoJ15BrWK4VdErD12E+PVvWQOnh7vR/N352/JI11ECu/HnxIiBr9ljzJdZl9QAmm3y1Khdrdlh3BEM8NlnBLn/dA18nQSW6v/jkkBSM7GlECnQslRFDEb2XAK1DT2Lt8ND5yNu7sVTYSy4sbzlflJ/bRXssKuM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CvmrXLpS; 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="CvmrXLpS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4A9EC4CECF; Tue, 19 Nov 2024 17:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1732037054; bh=qDJ+jFJs2nrMmgiAKvoyISCBFEAte5tiI1Hy68/otTA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CvmrXLpSokwxLZ6rrJ9U1pjcaoCoJjkX/Hd2GpiPdHwb1/Sf7IlgTY1zWjB6zJevC w/MqXv5O70iApelI1TQ0n/n9B/u38dE3dI9s9EOJDDz2a7ySU1fECRxFmaXJ7kEDUO RyTIC2GV1UgSnJPgiBzMybQgjmDMf/rpw/2FNlDQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-53068: firmware: arm_scmi: Fix slab-use-after-free in scmi_bus_notifier() Date: Tue, 19 Nov 2024 18:22:39 +0100 Message-ID: <2024111933-CVE-2024-53068-8c2a@gregkh> X-Mailer: git-send-email 2.47.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=5358; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qDJ+jFJs2nrMmgiAKvoyISCBFEAte5tiI1Hy68/otTA=; b=owGbwMvMwCRo6H6F97bub03G02pJDOk2JyO3furf5bDAp3RFoaukRkP9ywMtXmnzRDNPOAV48 uvwb5LviGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgImc8GRYcHGS6s8fev1zIgNm Cr5YMe3yrdTdXgzzXRpzHhvO5Xf0vXlJ88vjtO2uKw7oAwA= 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: firmware: arm_scmi: Fix slab-use-after-free in scmi_bus_notifier() The scmi_dev->name is released prematurely in __scmi_device_destroy(), which causes slab-use-after-free when accessing scmi_dev->name in scmi_bus_notifier(). So move the release of scmi_dev->name to scmi_device_release() to avoid slab-use-after-free. | BUG: KASAN: slab-use-after-free in strncmp+0xe4/0xec | Read of size 1 at addr ffffff80a482bcc0 by task swapper/0/1 | | CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.6.38-debug #1 | Hardware name: Qualcomm Technologies, Inc. SA8775P Ride (DT) | Call trace: | dump_backtrace+0x94/0x114 | show_stack+0x18/0x24 | dump_stack_lvl+0x48/0x60 | print_report+0xf4/0x5b0 | kasan_report+0xa4/0xec | __asan_report_load1_noabort+0x20/0x2c | strncmp+0xe4/0xec | scmi_bus_notifier+0x5c/0x54c | notifier_call_chain+0xb4/0x31c | blocking_notifier_call_chain+0x68/0x9c | bus_notify+0x54/0x78 | device_del+0x1bc/0x840 | device_unregister+0x20/0xb4 | __scmi_device_destroy+0xac/0x280 | scmi_device_destroy+0x94/0xd0 | scmi_chan_setup+0x524/0x750 | scmi_probe+0x7fc/0x1508 | platform_probe+0xc4/0x19c | really_probe+0x32c/0x99c | __driver_probe_device+0x15c/0x3c4 | driver_probe_device+0x5c/0x170 | __driver_attach+0x1c8/0x440 | bus_for_each_dev+0xf4/0x178 | driver_attach+0x3c/0x58 | bus_add_driver+0x234/0x4d4 | driver_register+0xf4/0x3c0 | __platform_driver_register+0x60/0x88 | scmi_driver_init+0xb0/0x104 | do_one_initcall+0xb4/0x664 | kernel_init_freeable+0x3c8/0x894 | kernel_init+0x24/0x1e8 | ret_from_fork+0x10/0x20 | | Allocated by task 1: | kasan_save_stack+0x2c/0x54 | kasan_set_track+0x2c/0x40 | kasan_save_alloc_info+0x24/0x34 | __kasan_kmalloc+0xa0/0xb8 | __kmalloc_node_track_caller+0x6c/0x104 | kstrdup+0x48/0x84 | kstrdup_const+0x34/0x40 | __scmi_device_create.part.0+0x8c/0x408 | scmi_device_create+0x104/0x370 | scmi_chan_setup+0x2a0/0x750 | scmi_probe+0x7fc/0x1508 | platform_probe+0xc4/0x19c | really_probe+0x32c/0x99c | __driver_probe_device+0x15c/0x3c4 | driver_probe_device+0x5c/0x170 | __driver_attach+0x1c8/0x440 | bus_for_each_dev+0xf4/0x178 | driver_attach+0x3c/0x58 | bus_add_driver+0x234/0x4d4 | driver_register+0xf4/0x3c0 | __platform_driver_register+0x60/0x88 | scmi_driver_init+0xb0/0x104 | do_one_initcall+0xb4/0x664 | kernel_init_freeable+0x3c8/0x894 | kernel_init+0x24/0x1e8 | ret_from_fork+0x10/0x20 | | Freed by task 1: | kasan_save_stack+0x2c/0x54 | kasan_set_track+0x2c/0x40 | kasan_save_free_info+0x38/0x5c | __kasan_slab_free+0xe8/0x164 | __kmem_cache_free+0x11c/0x230 | kfree+0x70/0x130 | kfree_const+0x20/0x40 | __scmi_device_destroy+0x70/0x280 | scmi_device_destroy+0x94/0xd0 | scmi_chan_setup+0x524/0x750 | scmi_probe+0x7fc/0x1508 | platform_probe+0xc4/0x19c | really_probe+0x32c/0x99c | __driver_probe_device+0x15c/0x3c4 | driver_probe_device+0x5c/0x170 | __driver_attach+0x1c8/0x440 | bus_for_each_dev+0xf4/0x178 | driver_attach+0x3c/0x58 | bus_add_driver+0x234/0x4d4 | driver_register+0xf4/0x3c0 | __platform_driver_register+0x60/0x88 | scmi_driver_init+0xb0/0x104 | do_one_initcall+0xb4/0x664 | kernel_init_freeable+0x3c8/0x894 | kernel_init+0x24/0x1e8 | ret_from_fork+0x10/0x20 The Linux kernel CVE team has assigned CVE-2024-53068 to this issue. Affected and fixed versions =========================== Issue introduced in 5.6 with commit ee7a9c9f67c5 and fixed in 6.6.61 with commit 15b17bbcea07 Issue introduced in 5.6 with commit ee7a9c9f67c5 and fixed in 6.11.8 with commit 1e1f523b185a Issue introduced in 5.6 with commit ee7a9c9f67c5 and fixed in 6.12 with commit 295416091e44 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-53068 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/firmware/arm_scmi/bus.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/15b17bbcea07d49c43d21aa700485cbd9f9d00d8 https://git.kernel.org/stable/c/1e1f523b185a8ccdcba625b31ff0312d052900e2 https://git.kernel.org/stable/c/295416091e44806760ccf753aeafdafc0ae268f3