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 2033D335567 for ; Wed, 24 Dec 2025 12:29:26 +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=1766579366; cv=none; b=PcGCL6eqt8DQqro/d9x6+ylrphp9u/YiMy9t+/hY9bQsSR9mA0VoimBDT1vb+BLBCwa9JBRfnrVUHhieDpCcUmKiFqqV8BEgfeZkKDVGUsVBIpANhBeiXUBrN3fbYCmtTucb+NXA4XR1VQuDI04LjsWz43WFXIPuAIfBo7l6GE0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766579366; c=relaxed/simple; bh=HLFbUehfVPZcVuWfIP9MT5NZV+VOs6DqkMM/aYcD6aw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GqPx21YXozHuc/NmNlNAhIX737nVDHNCt7CEd3LfRXCnTr71yaGNIltLRHShXVEh2oOrl/6GamoC5WK3IFFW1xEz6ihkYTB5mCNu4Tyf80SQ4dmrKUM9zNP5bNizUb00Ws5x8JNpmfOK3UHAO14Ii/2FXj5KgdwHJjGrxSTdaX0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YYTfXxuT; 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="YYTfXxuT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A06D9C4CEFB; Wed, 24 Dec 2025 12:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766579366; bh=HLFbUehfVPZcVuWfIP9MT5NZV+VOs6DqkMM/aYcD6aw=; h=From:To:Cc:Subject:Date:Reply-To:From; b=YYTfXxuT/DHvQm4BJC5SaXvNIBU4+Wrx/ExpDD2H8tuORJyqri9GRErV3B6WN64yZ x05R7oKpoW54xmg3VLEon45w2v1dqCH98bcyzO51a6Cx/lxcQJntpOM9FmwA2UQXNF Rv+WhyCwQ2eZ23duvu8hTISKZhfpLMNdDUifuJy0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-54061: x86: fix clear_user_rep_good() exception handling annotation Date: Wed, 24 Dec 2025 13:26:54 +0100 Message-ID: <2025122428-CVE-2023-54061-5cd1@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4944; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=CNfI7OxHDuxw0DDsUA8H35BCSkYt16MDBwv3QuEVu9Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnet7/IHXu03dHo8Jtjc18L9sfMEJIs0tH1DeYrVJ6+q 372tfY3HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARlkqGueJWAuULru2843Xo g1pZFJ+RysPdcgzzcyzyVq42WbxToMDZQPB2ao/dlARDAA== 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: x86: fix clear_user_rep_good() exception handling annotation This code no longer exists in mainline, because it was removed in commit d2c95f9d6802 ("x86: don't use REP_GOOD or ERMS for user memory clearing") upstream. However, rather than backport the full range of x86 memory clearing and copying cleanups, fix the exception table annotation placement for the final 'rep movsb' in clear_user_rep_good(): rather than pointing at the actual instruction that did the user space access, it pointed to the register move just before it. That made sense from a code flow standpoint, but not from an actual usage standpoint: it means that if user access takes an exception, the exception handler won't actually find the instruction in the exception tables. As a result, rather than fixing it up and returning -EFAULT, it would then turn it into a kernel oops report instead, something like: BUG: unable to handle page fault for address: 0000000020081000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page ... RIP: 0010:clear_user_rep_good+0x1c/0x30 arch/x86/lib/clear_page_64.S:147 ... Call Trace: __clear_user arch/x86/include/asm/uaccess_64.h:103 [inline] clear_user arch/x86/include/asm/uaccess_64.h:124 [inline] iov_iter_zero+0x709/0x1290 lib/iov_iter.c:800 iomap_dio_hole_iter fs/iomap/direct-io.c:389 [inline] iomap_dio_iter fs/iomap/direct-io.c:440 [inline] __iomap_dio_rw+0xe3d/0x1cd0 fs/iomap/direct-io.c:601 iomap_dio_rw+0x40/0xa0 fs/iomap/direct-io.c:689 ext4_dio_read_iter fs/ext4/file.c:94 [inline] ext4_file_read_iter+0x4be/0x690 fs/ext4/file.c:145 call_read_iter include/linux/fs.h:2183 [inline] do_iter_readv_writev+0x2e0/0x3b0 fs/read_write.c:733 do_iter_read+0x2f2/0x750 fs/read_write.c:796 vfs_readv+0xe5/0x150 fs/read_write.c:916 do_preadv+0x1b6/0x270 fs/read_write.c:1008 __do_sys_preadv2 fs/read_write.c:1070 [inline] __se_sys_preadv2 fs/read_write.c:1061 [inline] __x64_sys_preadv2+0xef/0x150 fs/read_write.c:1061 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd which then looks like a filesystem bug rather than the incorrect exception annotation that it is. [ The alternative to this one-liner fix is to take the upstream series that cleans this all up: 68674f94ffc9 ("x86: don't use REP_GOOD or ERMS for small memory copies") 20f3337d350c ("x86: don't use REP_GOOD or ERMS for small memory clearing") adfcf4231b8c ("x86: don't use REP_GOOD or ERMS for user memory copies") * d2c95f9d6802 ("x86: don't use REP_GOOD or ERMS for user memory clearing") 3639a535587d ("x86: move stac/clac from user copy routines into callers") 577e6a7fd50d ("x86: inline the 'rep movs' in user copies for the FSRM case") 8c9b6a88b7e2 ("x86: improve on the non-rep 'clear_user' function") 427fda2c8a49 ("x86: improve on the non-rep 'copy_user' function") * e046fe5a36a9 ("x86: set FSRS automatically on AMD CPUs that have FSRM") e1f2750edc4a ("x86: remove 'zerorest' argument from __copy_user_nocache()") 034ff37d3407 ("x86: rewrite '__copy_user_nocache' function") with either the whole series or at a minimum the two marked commits being needed to fix this issue ] The Linux kernel CVE team has assigned CVE-2023-54061 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit 0db7058e8e23e6bbab1b4747ecabd1784c34f50b and fixed in 6.3.3 with commit b805d212c394f291f116b12c53401e7ba0c4d408 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-54061 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/x86/lib/clear_page_64.S 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/b805d212c394f291f116b12c53401e7ba0c4d408