CVE-2021-47227
What it is
In the Linux kernel, the following vulnerability has been resolved: x86/fpu: Prevent state corruption in __fpu__restore_sig() The non-compacted slowpath uses __copy_from_user() and copies the entire user buffer into the kernel buffer, verbatim. This means that the kernel buffer may now contain entirely invalid state on which XRSTOR will #GP. validate_user_xstate_header() can detect some of that corruption, but that leaves the onus on callers to clear the buffer. Prior to XSAVES support, it was possible just to reinitialize the buffer, completely, but with supervisor states that is not longer possible as the buffer clearing code split got it backwards. Fixing that is possible but not corrupting the state in the first place is more robust. Avoid corruption of the kernel XSAVE buffer by using copy_user_to_xstate() which validates the XSAVE header contents before copying the actual states to the kernel. copy_user_to_xstate() was previously only called for compacted-format kernel buffers, but it works for both compacted and non-compacted forms. Using it for the non-compacted form is slower because of multiple __copy_from_user() operations, but that cost is less important than robust code in an already slow path. [ Changelog polished by Dave Hansen ]
At a glance
- Exploitability
- Can be exploited locally on the machine with a low-privilege account. High risk of service disruption.
- Exploit odds
- 0.2% chance of exploitation in the next 30 days (EPSS).
- Fix
- A patch, advisory or fixed version is referenced. Upgrade or apply it.
Timeline
- PublishedDisclosed publicly on CVE.org and NVD
- Last updatedMost recent change to the record
Why it ranks here
- Exploited in the wild: no, CISA does not list it.
- Exploit odds: 0.2% in the next 30 days (EPSS).
- Severity: 5.5 MEDIUM (CVSS).
- Fix: a patch or advisory is linked.
Details
- Published
- Last modified
- Exploit probability
- 0.2% · EPSS, next 30 days
- Weakness
- CWE-754
- Record status
- Analyzed
Affected
- Linux Kernel < 5.10.46
- Linux Kernel < 5.12.13
- Linux Kernel 5.13
Attack profile CVSS 3.1 · 5.5
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Raw vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Is it in your code?
Hand this to your coding agent. It searches your project for the affected products and checks versions. Nothing leaves your machine.
Read https://cve-list.com/agent/cve/CVE-2021-47227.md and follow it. Check whether this project is affected by CVE-2021-47227. Read only. Don't change anything and don't upload my code. Tell me yes, no or not sure, with the file as proof.
Fix and advisories
- https://git.kernel.org/stable/c/076f732b16a5bf842686e1b43ab6021a2d98233e
- https://git.kernel.org/stable/c/484cea4f362e1eeb5c869abbfb5f90eae6421b38
- https://git.kernel.org/stable/c/ec25ea1f3f05d6f8ee51d1277efea986eafd4f2a
- https://git.kernel.org/stable/c/076f732b16a5bf842686e1b43ab6021a2d98233e
- https://git.kernel.org/stable/c/484cea4f362e1eeb5c869abbfb5f90eae6421b38
- https://git.kernel.org/stable/c/ec25ea1f3f05d6f8ee51d1277efea986eafd4f2a
References
- https://git.kernel.org/stable/c/076f732b16a5bf842686e1b43ab6021a2d98233e
- https://git.kernel.org/stable/c/484cea4f362e1eeb5c869abbfb5f90eae6421b38
- https://git.kernel.org/stable/c/ec25ea1f3f05d6f8ee51d1277efea986eafd4f2a
- https://git.kernel.org/stable/c/076f732b16a5bf842686e1b43ab6021a2d98233e
- https://git.kernel.org/stable/c/484cea4f362e1eeb5c869abbfb5f90eae6421b38
- https://git.kernel.org/stable/c/ec25ea1f3f05d6f8ee51d1277efea986eafd4f2a