Bug 2165926 (CVE-2023-0597) - CVE-2023-0597 kernel: x86/mm: Randomize per-cpu entry area
Summary: CVE-2023-0597 kernel: x86/mm: Randomize per-cpu entry area
Keywords:
Status: NEW
Alias: CVE-2023-0597
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On: 2165927 2165931 2165932 2165933 2165934 2165935
Blocks: 2158425
TreeView+ depends on / blocked
 
Reported: 2023-01-31 13:46 UTC by Alex
Modified: 2024-03-12 16:24 UTC (History)
54 users (show)

Fixed In Version: Linux kernel 6.2-rc1
Doc Type: If docs needed, set a value
Doc Text:
A possible unauthorized memory access flaw was found in the Linux kernel cpu_entry_area mapping of X86 CPU data to memory, where a user may guess the location of exception stack(s) or other important data. This issue could allow a local user to gain access to some important data with expected location in memory.
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2023:6835 0 None None None 2023-11-09 07:10:43 UTC
Red Hat Product Errata RHBA-2023:7268 0 None None None 2023-11-15 18:25:13 UTC
Red Hat Product Errata RHBA-2023:7328 0 None None None 2023-11-16 11:38:45 UTC
Red Hat Product Errata RHBA-2023:7338 0 None None None 2023-11-16 18:04:04 UTC
Red Hat Product Errata RHBA-2023:7343 0 None None None 2023-11-20 01:58:29 UTC
Red Hat Product Errata RHBA-2023:7346 0 None None None 2023-11-20 09:25:33 UTC
Red Hat Product Errata RHSA-2023:6583 0 None None None 2023-11-07 08:20:03 UTC
Red Hat Product Errata RHSA-2023:6901 0 None None None 2023-11-14 15:14:52 UTC
Red Hat Product Errata RHSA-2023:7077 0 None None None 2023-11-14 15:20:30 UTC
Red Hat Product Errata RHSA-2024:1188 0 None None None 2024-03-06 12:37:46 UTC

Description Alex 2023-01-31 13:46:17 UTC
A flaw possibility of memory leak in the Linux Kernel found.
There is no randomization of the exception stacks happening at all including boot-time randomization. These exception
stacks are mapped into the kernel at the same virtual address every time.
The exception stack(s) is a particularly easy target because its location can be computed based solely on CPU index and kernel version.
For the CPU-entry-area, the piece of per-cpu data that is mapped into the userspace page-tables for KPTI is not subject to any randomization (irrespective of KASLR settings). The KASLR-style randomization isn't enough, because attacker probably could discover even the task stacks at least on X86 systems without KPTI with something like the prefetch timing side channel that can test for PTE existence (see reference to the prefetch.pdf).
Sure, the system call stack is randomized, but that randomization happens after kernel entry and after pt_regs have been saved. It would be good if at least in the worst-case scenario of an attack against the kernel, an attacker wouldn't know fixed addresses where zeroes / kernel text pointers / other known values are stored.
As result, straight forward randomization scheme that avoids duplicates to spread the existing CPUs over the available space suggested (see reference to the patch).

References:
https://gruss.cc/files/prefetch.pdf
https://lore.kernel.org/lkml/Yz%2FmfJ1gjgshF19t@hirez.programming.kicks-ass.net/
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/mm/cpu_entry_area.c?h=v6.2-rc6&id=97e3d26b5e5f371b3ee223d94dd123e6c442ba80

Comment 1 Alex 2023-01-31 13:46:51 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2165927]

Comment 11 errata-xmlrpc 2023-11-07 08:19:58 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2023:6583 https://access.redhat.com/errata/RHSA-2023:6583

Comment 12 errata-xmlrpc 2023-11-14 15:14:47 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2023:6901 https://access.redhat.com/errata/RHSA-2023:6901

Comment 13 errata-xmlrpc 2023-11-14 15:20:25 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2023:7077 https://access.redhat.com/errata/RHSA-2023:7077

Comment 16 errata-xmlrpc 2024-03-06 12:37:42 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.6 Extended Update Support

Via RHSA-2024:1188 https://access.redhat.com/errata/RHSA-2024:1188


Note You need to log in before you can comment on or make changes to this bug.