Skip to content

In the Linux kernel, the following vulnerability has been...

High severity Unreviewed Published Jun 25, 2024 to the GitHub Advisory Database • Updated Jul 11, 2024

Package

No package listedSuggest a package

Affected versions

Unknown

Patched versions

Unknown

Description

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

x86/xen: Drop USERGS_SYSRET64 paravirt call

commit afd30525a659ac0ae0904f0cb4a2ca75522c3123 upstream.

USERGS_SYSRET64 is used to return from a syscall via SYSRET, but
a Xen PV guest will nevertheless use the IRET hypercall, as there
is no sysret PV hypercall defined.

So instead of testing all the prerequisites for doing a sysret and
then mangling the stack for Xen PV again for doing an iret just use
the iret exit from the beginning.

This can easily be done via an ALTERNATIVE like it is done for the
sysenter compat case already.

It should be noted that this drops the optimization in Xen for not
restoring a few registers when returning to user mode, but it seems
as if the saved instructions in the kernel more than compensate for
this drop (a kernel build in a Xen PV guest was slightly faster with
this patch applied).

While at it remove the stale sysret32 remnants.

[ pawan: Brad Spengler and Salvatore Bonaccorso [email protected]
reported a problem with the 5.10 backport commit edc702b4a820
("x86/entry_64: Add VERW just before userspace transition").

   When CONFIG_PARAVIRT_XXL=y, CLEAR_CPU_BUFFERS is not executed in
   syscall_return_via_sysret path as USERGS_SYSRET64 is runtime
   patched to:

.cpu_usergs_sysret64    = { 0x0f, 0x01, 0xf8,
			    0x48, 0x0f, 0x07 }, // swapgs; sysretq

   which is missing CLEAR_CPU_BUFFERS. It turns out dropping
   USERGS_SYSRET64 simplifies the code, allowing CLEAR_CPU_BUFFERS
   to be explicitly added to syscall_return_via_sysret path. Below
   is with CONFIG_PARAVIRT_XXL=y and this patch applied:

   syscall_return_via_sysret:
   ...
   <+342>:   swapgs
   <+345>:   xchg   %ax,%ax
   <+347>:   verw   -0x1a2(%rip)  <------
   <+354>:   sysretq

]

References

Published by the National Vulnerability Database Jun 25, 2024
Published to the GitHub Advisory Database Jun 25, 2024
Last updated Jul 11, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

EPSS score

0.043%
(10th percentile)

Weaknesses

CVE ID

CVE-2021-4440

GHSA ID

GHSA-vc52-cgfp-jw27

Source code

No known source code

Dependabot alerts are not supported on this advisory because it does not have a package from a supported ecosystem with an affected and fixed version.

Learn more about GitHub language support

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.