# CVE-2023-53642: x86: fix clear\_user\_rep\_good() exception handling annotation

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 7, 2026-11-26)
- **Published:** 2025-10-07T15:19:41.693Z
- **Modified:** 2026-06-17T06:45:46.813Z

## Who should check

- Anyone running Linux \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< 76ce32682635fe907e0f8e64e039e773e5c7508f; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< 90510aed20a26e1a4dede4ef6b640e6a4122f38f; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< b805d212c394f291f116b12c53401e7ba0c4d408; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< e046fe5a36a970bc14fbfbcb2074a48776f6b671
- Anyone running Linux 6.1

## 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 \]

## Affected and fixed versions

- Linux: \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< 76ce32682635fe907e0f8e64e039e773e5c7508f; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< 90510aed20a26e1a4dede4ef6b640e6a4122f38f; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< b805d212c394f291f116b12c53401e7ba0c4d408; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< e046fe5a36a970bc14fbfbcb2074a48776f6b671 (cvelist)
- Linux: 6.1 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-53642. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-53642.md
Affected: Linux >= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, < 76ce32682635fe907e0f8e64e039e773e5c7508f; >= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, < 90510aed20a26e1a4dede4ef6b640e6a4122f38f; >= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, < b805d212c394f291f116b12c53401e7ba0c4d408; >= 0db7058e8e23e6bbab1b474…
Fixed in: Linux 76ce32682635fe907e0f8e64e039e773e5c7508f, Linux 90510aed20a26e1a4dede4ef6b640e6a4122f38f

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-53642 being exploited?

There is no confirmed exploitation: CVE-2023-53642 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.22% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-53642?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-53642?

Linux \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< 76ce32682635fe907e0f8e64e039e773e5c7508f; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< 90510aed20a26e1a4dede4ef6b640e6a4122f38f; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< b805d212c394f291f116b12c53401e7ba0c4d408; \>= 0db7058e8e23e6bbab1b4747ecabd1784c34f50b, \< e046fe5a36a970bc14fbfbcb2074a48776f6b671; Linux 6.1.

### Is there a fix for CVE-2023-53642?

Yes. Fixed in Linux 76ce32682635fe907e0f8e64e039e773e5c7508f, Linux 90510aed20a26e1a4dede4ef6b640e6a4122f38f. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-53642?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/76ce32682635fe907e0f8e64e039e773e5c7508f>
- patch: <https://git.kernel.org/stable/c/90510aed20a26e1a4dede4ef6b640e6a4122f38f>
- patch: <https://git.kernel.org/stable/c/b805d212c394f291f116b12c53401e7ba0c4d408>
- patch: <https://git.kernel.org/stable/c/e046fe5a36a970bc14fbfbcb2074a48776f6b671>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-53642>

HTML: <https://flawdb.com/CVE-2023-53642> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-53642>
