Lucene search

K
cvelistLinuxCVELIST:CVE-2024-26603
HistoryFeb 24, 2024 - 2:56 p.m.

CVE-2024-26603 x86/fpu: Stop relying on userspace for info to fault in xsave buffer

2024-02-2414:56:57
Linux
www.cve.org
3
linux kernel
vulnerability
x86/fpu
userspace
info
fault
xsave buffer
size
sigreturn frame
xrstor
fault_in_readable

6.5 Medium

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

5.1%

In the Linux kernel, the following vulnerability has been resolved:

x86/fpu: Stop relying on userspace for info to fault in xsave buffer

Before this change, the expected size of the user space buffer was
taken from fx_sw->xstate_size. fx_sw->xstate_size can be changed
from user-space, so it is possible construct a sigreturn frame where:

  • fx_sw->xstate_size is smaller than the size required by valid bits in
    fx_sw->xfeatures.
  • user-space unmaps parts of the sigrame fpu buffer so that not all of
    the buffer required by xrstor is accessible.

In this case, xrstor tries to restore and accesses the unmapped area
which results in a fault. But fault_in_readable succeeds because buf +
fx_sw->xstate_size is within the still mapped area, so it goes back and
tries xrstor again. It will spin in this loop forever.

Instead, fault in the maximum size which can be touched by XRSTOR (taken
from fpstate->user_size).

[ dhansen: tweak subject / changelog ]

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "arch/x86/kernel/fpu/signal.c"
    ],
    "versions": [
      {
        "version": "fcb3635f5018",
        "lessThan": "8bd3eee7720c",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "fcb3635f5018",
        "lessThan": "627339cccdc9",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "fcb3635f5018",
        "lessThan": "b2479ab426ce",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "fcb3635f5018",
        "lessThan": "627e28cbb655",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "fcb3635f5018",
        "lessThan": "d877550eaf2d",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "arch/x86/kernel/fpu/signal.c"
    ],
    "versions": [
      {
        "version": "5.14",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "5.14",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.15.150",
        "lessThanOrEqual": "5.15.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.1.79",
        "lessThanOrEqual": "6.1.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.6.18",
        "lessThanOrEqual": "6.6.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.7.6",
        "lessThanOrEqual": "6.7.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.8",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]

6.5 Medium

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

5.1%