CVE-2023-53642 (GCVE-0-2023-53642)
Vulnerability from cvelistv5
Published
2025-10-07 15:19
Modified
2025-10-10 16:10
Severity ?
Summary
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 ]
Impacted products
Vendor Product Version
Linux Linux Version: 0db7058e8e23e6bbab1b4747ecabd1784c34f50b
Version: 0db7058e8e23e6bbab1b4747ecabd1784c34f50b
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/lib/clear_page_64.S"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "76ce32682635fe907e0f8e64e039e773e5c7508f",
              "status": "affected",
              "version": "0db7058e8e23e6bbab1b4747ecabd1784c34f50b",
              "versionType": "git"
            },
            {
              "lessThan": "e046fe5a36a970bc14fbfbcb2074a48776f6b671",
              "status": "affected",
              "version": "0db7058e8e23e6bbab1b4747ecabd1784c34f50b",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/lib/clear_page_64.S"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.1"
            },
            {
              "lessThan": "6.1",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.29",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.4",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.29",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.4",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nx86: fix clear_user_rep_good() exception handling annotation\n\nThis code no longer exists in mainline, because it was removed in\ncommit d2c95f9d6802 (\"x86: don\u0027t use REP_GOOD or ERMS for user memory\nclearing\") upstream.\n\nHowever, rather than backport the full range of x86 memory clearing and\ncopying cleanups, fix the exception table annotation placement for the\nfinal \u0027rep movsb\u0027 in clear_user_rep_good(): rather than pointing at the\nactual instruction that did the user space access, it pointed to the\nregister move just before it.\n\nThat made sense from a code flow standpoint, but not from an actual\nusage standpoint: it means that if user access takes an exception, the\nexception handler won\u0027t actually find the instruction in the exception\ntables.\n\nAs a result, rather than fixing it up and returning -EFAULT, it would\nthen turn it into a kernel oops report instead, something like:\n\n    BUG: unable to handle page fault for address: 0000000020081000\n    #PF: supervisor write access in kernel mode\n    #PF: error_code(0x0002) - not-present page\n    ...\n    RIP: 0010:clear_user_rep_good+0x1c/0x30 arch/x86/lib/clear_page_64.S:147\n    ...\n    Call Trace:\n      __clear_user arch/x86/include/asm/uaccess_64.h:103 [inline]\n      clear_user arch/x86/include/asm/uaccess_64.h:124 [inline]\n      iov_iter_zero+0x709/0x1290 lib/iov_iter.c:800\n      iomap_dio_hole_iter fs/iomap/direct-io.c:389 [inline]\n      iomap_dio_iter fs/iomap/direct-io.c:440 [inline]\n      __iomap_dio_rw+0xe3d/0x1cd0 fs/iomap/direct-io.c:601\n      iomap_dio_rw+0x40/0xa0 fs/iomap/direct-io.c:689\n      ext4_dio_read_iter fs/ext4/file.c:94 [inline]\n      ext4_file_read_iter+0x4be/0x690 fs/ext4/file.c:145\n      call_read_iter include/linux/fs.h:2183 [inline]\n      do_iter_readv_writev+0x2e0/0x3b0 fs/read_write.c:733\n      do_iter_read+0x2f2/0x750 fs/read_write.c:796\n      vfs_readv+0xe5/0x150 fs/read_write.c:916\n      do_preadv+0x1b6/0x270 fs/read_write.c:1008\n      __do_sys_preadv2 fs/read_write.c:1070 [inline]\n      __se_sys_preadv2 fs/read_write.c:1061 [inline]\n      __x64_sys_preadv2+0xef/0x150 fs/read_write.c:1061\n      do_syscall_x64 arch/x86/entry/common.c:50 [inline]\n      do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80\n      entry_SYSCALL_64_after_hwframe+0x63/0xcd\n\nwhich then looks like a filesystem bug rather than the incorrect\nexception annotation that it is.\n\n[ The alternative to this one-liner fix is to take the upstream series\n  that cleans this all up:\n\n    68674f94ffc9 (\"x86: don\u0027t use REP_GOOD or ERMS for small memory copies\")\n    20f3337d350c (\"x86: don\u0027t use REP_GOOD or ERMS for small memory clearing\")\n    adfcf4231b8c (\"x86: don\u0027t use REP_GOOD or ERMS for user memory copies\")\n  * d2c95f9d6802 (\"x86: don\u0027t use REP_GOOD or ERMS for user memory clearing\")\n    3639a535587d (\"x86: move stac/clac from user copy routines into callers\")\n    577e6a7fd50d (\"x86: inline the \u0027rep movs\u0027 in user copies for the FSRM case\")\n    8c9b6a88b7e2 (\"x86: improve on the non-rep \u0027clear_user\u0027 function\")\n    427fda2c8a49 (\"x86: improve on the non-rep \u0027copy_user\u0027 function\")\n  * e046fe5a36a9 (\"x86: set FSRS automatically on AMD CPUs that have FSRM\")\n    e1f2750edc4a (\"x86: remove \u0027zerorest\u0027 argument from __copy_user_nocache()\")\n    034ff37d3407 (\"x86: rewrite \u0027__copy_user_nocache\u0027 function\")\n\n  with either the whole series or at a minimum the two marked commits\n  being needed to fix this issue ]"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-10-10T16:10:26.276Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/76ce32682635fe907e0f8e64e039e773e5c7508f"
        },
        {
          "url": "https://git.kernel.org/stable/c/e046fe5a36a970bc14fbfbcb2074a48776f6b671"
        }
      ],
      "title": "x86: fix clear_user_rep_good() exception handling annotation",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-53642",
    "datePublished": "2025-10-07T15:19:41.693Z",
    "dateReserved": "2025-10-07T15:16:59.658Z",
    "dateUpdated": "2025-10-10T16:10:26.276Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2023-53642\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-10-07T16:15:47.517\",\"lastModified\":\"2025-10-10T16:15:51.447\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nx86: fix clear_user_rep_good() exception handling annotation\\n\\nThis code no longer exists in mainline, because it was removed in\\ncommit d2c95f9d6802 (\\\"x86: don\u0027t use REP_GOOD or ERMS for user memory\\nclearing\\\") upstream.\\n\\nHowever, rather than backport the full range of x86 memory clearing and\\ncopying cleanups, fix the exception table annotation placement for the\\nfinal \u0027rep movsb\u0027 in clear_user_rep_good(): rather than pointing at the\\nactual instruction that did the user space access, it pointed to the\\nregister move just before it.\\n\\nThat made sense from a code flow standpoint, but not from an actual\\nusage standpoint: it means that if user access takes an exception, the\\nexception handler won\u0027t actually find the instruction in the exception\\ntables.\\n\\nAs a result, rather than fixing it up and returning -EFAULT, it would\\nthen turn it into a kernel oops report instead, something like:\\n\\n    BUG: unable to handle page fault for address: 0000000020081000\\n    #PF: supervisor write access in kernel mode\\n    #PF: error_code(0x0002) - not-present page\\n    ...\\n    RIP: 0010:clear_user_rep_good+0x1c/0x30 arch/x86/lib/clear_page_64.S:147\\n    ...\\n    Call Trace:\\n      __clear_user arch/x86/include/asm/uaccess_64.h:103 [inline]\\n      clear_user arch/x86/include/asm/uaccess_64.h:124 [inline]\\n      iov_iter_zero+0x709/0x1290 lib/iov_iter.c:800\\n      iomap_dio_hole_iter fs/iomap/direct-io.c:389 [inline]\\n      iomap_dio_iter fs/iomap/direct-io.c:440 [inline]\\n      __iomap_dio_rw+0xe3d/0x1cd0 fs/iomap/direct-io.c:601\\n      iomap_dio_rw+0x40/0xa0 fs/iomap/direct-io.c:689\\n      ext4_dio_read_iter fs/ext4/file.c:94 [inline]\\n      ext4_file_read_iter+0x4be/0x690 fs/ext4/file.c:145\\n      call_read_iter include/linux/fs.h:2183 [inline]\\n      do_iter_readv_writev+0x2e0/0x3b0 fs/read_write.c:733\\n      do_iter_read+0x2f2/0x750 fs/read_write.c:796\\n      vfs_readv+0xe5/0x150 fs/read_write.c:916\\n      do_preadv+0x1b6/0x270 fs/read_write.c:1008\\n      __do_sys_preadv2 fs/read_write.c:1070 [inline]\\n      __se_sys_preadv2 fs/read_write.c:1061 [inline]\\n      __x64_sys_preadv2+0xef/0x150 fs/read_write.c:1061\\n      do_syscall_x64 arch/x86/entry/common.c:50 [inline]\\n      do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80\\n      entry_SYSCALL_64_after_hwframe+0x63/0xcd\\n\\nwhich then looks like a filesystem bug rather than the incorrect\\nexception annotation that it is.\\n\\n[ The alternative to this one-liner fix is to take the upstream series\\n  that cleans this all up:\\n\\n    68674f94ffc9 (\\\"x86: don\u0027t use REP_GOOD or ERMS for small memory copies\\\")\\n    20f3337d350c (\\\"x86: don\u0027t use REP_GOOD or ERMS for small memory clearing\\\")\\n    adfcf4231b8c (\\\"x86: don\u0027t use REP_GOOD or ERMS for user memory copies\\\")\\n  * d2c95f9d6802 (\\\"x86: don\u0027t use REP_GOOD or ERMS for user memory clearing\\\")\\n    3639a535587d (\\\"x86: move stac/clac from user copy routines into callers\\\")\\n    577e6a7fd50d (\\\"x86: inline the \u0027rep movs\u0027 in user copies for the FSRM case\\\")\\n    8c9b6a88b7e2 (\\\"x86: improve on the non-rep \u0027clear_user\u0027 function\\\")\\n    427fda2c8a49 (\\\"x86: improve on the non-rep \u0027copy_user\u0027 function\\\")\\n  * e046fe5a36a9 (\\\"x86: set FSRS automatically on AMD CPUs that have FSRM\\\")\\n    e1f2750edc4a (\\\"x86: remove \u0027zerorest\u0027 argument from __copy_user_nocache()\\\")\\n    034ff37d3407 (\\\"x86: rewrite \u0027__copy_user_nocache\u0027 function\\\")\\n\\n  with either the whole series or at a minimum the two marked commits\\n  being needed to fix this issue ]\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/76ce32682635fe907e0f8e64e039e773e5c7508f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e046fe5a36a970bc14fbfbcb2074a48776f6b671\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…