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 478D519004A for ; Fri, 2 May 2025 16:00:42 +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=1746201642; cv=none; b=oQbxVEad8XsptyLB1uB9z6xdTQi/SNBS96KdYU973z7xdyyJJpqHyrKBIiwx7K/GarNb/oBJ3pdrzry/myRObL2GefdHDKYG6pEkbeNh08EUClU2zyZkQJZUcgzDtzFv2wl4qUYW/PDA6+TvGB4E8vmbkqx68lE5UabGVo0aaKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746201642; c=relaxed/simple; bh=Kp18OEkkKK3NAdl6jgFrXBVLIVNM7U2+6Un45j506nE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VcZbzb14T+doEk6kxPAz+1ynkmdMwJOy1ZdeasXJgdk3SXC5ZPybOc46ujzp45YZgJf6SSeaBDiXrACij7dHESrIMnuCgVLdhmuD+Q7hDWPQk7mDv0s7ccvQDSBj2N3nRt4guZ1ZBKihUVHCXIO2TtETwBMcfkm9qOcLuOAqipM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fdIuVCUK; 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="fdIuVCUK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8406C4CEE4; Fri, 2 May 2025 16:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746201642; bh=Kp18OEkkKK3NAdl6jgFrXBVLIVNM7U2+6Un45j506nE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=fdIuVCUKxcHL9ZF7VhPZpHhgPZRFClOOws5DGMMQWfPVeChSXXmFGIl3SLodXrcLB 9mt8f2rcp0FjA21+S2kMQMz3lk3eK0HvWXiU2KFztqFrEs9fNKkwXUZ6Zn6ZQl7qbp u5JfP85LD0kge3ZoHORuZDyi44NznY2TKE4rQ6Aw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53122: RISC-V: fix taking the text_mutex twice during sifive errata patching Date: Fri, 2 May 2025 17:56:27 +0200 Message-ID: <2025050231-CVE-2023-53122-2296@gregkh> X-Mailer: git-send-email 2.49.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=3515; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=RtefFBZWGJQ5xiQoGpZELarXUl22U/cGzYvHvy72COU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkirz5Py837oNF8f6pQ76dWpjc+qiVXtKI2O/vOLnTZM WlZUNPLjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIQjnDgtUbo8waOb5dL5pn OW27dHXP7+BLSQwLlk2WEMzQsT5QcYejhG2iJEPPIUM+AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: RISC-V: fix taking the text_mutex twice during sifive errata patching Chris pointed out that some bonehead, *cough* me *cough*, added two mutex_locks() to the SiFive errata patching. The second was meant to have been a mutex_unlock(). This results in errors such as Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 Oops [#1] Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 6.2.0-rc1-starlight-00079-g9493e6f3ce02 #229 Hardware name: BeagleV Starlight Beta (DT) epc : __schedule+0x42/0x500 ra : schedule+0x46/0xce epc : ffffffff8065957c ra : ffffffff80659a80 sp : ffffffff81203c80 gp : ffffffff812d50a0 tp : ffffffff8120db40 t0 : ffffffff81203d68 t1 : 0000000000000001 t2 : 4c45203a76637369 s0 : ffffffff81203cf0 s1 : ffffffff8120db40 a0 : 0000000000000000 a1 : ffffffff81213958 a2 : ffffffff81213958 a3 : 0000000000000000 a4 : 0000000000000000 a5 : ffffffff80a1bd00 a6 : 0000000000000000 a7 : 0000000052464e43 s2 : ffffffff8120db41 s3 : ffffffff80a1ad00 s4 : 0000000000000000 s5 : 0000000000000002 s6 : ffffffff81213938 s7 : 0000000000000000 s8 : 0000000000000000 s9 : 0000000000000001 s10: ffffffff812d7204 s11: ffffffff80d3c920 t3 : 0000000000000001 t4 : ffffffff812e6dd7 t5 : ffffffff812e6dd8 t6 : ffffffff81203bb8 status: 0000000200000100 badaddr: 0000000000000030 cause: 000000000000000d [] schedule+0x46/0xce [] schedule_preempt_disabled+0x16/0x28 [] __mutex_lock.constprop.0+0x3fe/0x652 [] __mutex_lock_slowpath+0xe/0x16 [] mutex_lock+0x42/0x4c [] sifive_errata_patch_func+0xf6/0x18c [] _apply_alternatives+0x74/0x76 [] apply_boot_alternatives+0x3c/0xfa [] setup_arch+0x60c/0x640 [] start_kernel+0x8e/0x99c ---[ end trace 0000000000000000 ]--- [Palmer: pick up Geert's bug report from the thread] The Linux kernel CVE team has assigned CVE-2023-53122 to this issue. Affected and fixed versions =========================== Issue fixed in mainline with commit bf89b7e 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-2023-53122 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: arch/riscv/errata/sifive/errata.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/2feac714c6818f7767cfc21a3c10fa926b7398a3 https://git.kernel.org/stable/c/96a1600461957731b6d8ff3563c9f94b315bdaa1 https://git.kernel.org/stable/c/bf89b7ee52af5a5944fa3539e86089f72475055b