Bug 813428 (CVE-2012-0217) - CVE-2012-0217 kernel: x86-64: avoid sysret to non-canonical address
Summary: CVE-2012-0217 kernel: x86-64: avoid sysret to non-canonical address
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2012-0217
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 813430 813431 817489
Blocks: 813442 815484 823418
TreeView+ depends on / blocked
 
Reported: 2012-04-17 18:30 UTC by Petr Matousek
Modified: 2023-05-11 19:22 UTC (History)
23 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
It was found that the Xen hypervisor implementation as shipped with Red Hat Enterprise Linux 5 did not properly restrict the syscall return addresses in the sysret return path to canonical addresses. An unprivileged user in a 64-bit para-virtualized guest, that is running on a 64-bit host that has an Intel CPU, could use this flaw to crash the host or, potentially, escalate their privileges, allowing them to execute arbitrary code at the hypervisor level.
Clone Of:
Environment:
Last Closed: 2014-08-06 15:37:24 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0720 0 normal SHIPPED_LIVE Important: kernel security and bug fix update 2012-06-20 11:47:10 UTC
Red Hat Product Errata RHSA-2012:0721 0 normal SHIPPED_LIVE Important: kernel security update 2012-06-12 18:12:50 UTC

Description Petr Matousek 2012-04-17 18:30:05 UTC
On Intel CPUs sysret to non-canonical address causes a fault on the sysret instruction itself after the stack pointer is set to guest value but before the CPL is changed. Systems running on AMD CPUs are not vulnerable to this issue as sysret on AMD CPUs does not generate a fault before the CPL change.

On Xen, a privileged user on a 64 bit PV guest kernel running on a 64 bit hypervisor could use this flaw to escalate privileges to that of the host. Depending on the particular guest kernel it is also possible that non-privileged guest users could also elevate their privileges to that of the host.

For Red Hat Enterprise Linux guests, only privileged guest users can exploit this issue. HVM guests and 32-bit PV guests cannot be used to exploit this issue.

Acknowledgements:

Red Hat would like to thank the Xen project for reporting this issue. Upstream acknowledges Rafal Wojtczuk as the original reporter.

Comment 21 Petr Matousek 2012-04-27 09:33:34 UTC
Statement:

This issue did not affect the versions of the Linux kernel as shipped with Red Hat Enterprise Linux 5 and 6, and Red Hat Enterprise MRG, as those versions have a guard page between the end of the user-mode accessible virtual address space and the beginning of the non-canonical area due to CVE-2005-1764 fix, and hardened system call handler due to CVE-2006-0744 fix.

This issue did affect the versions of Xen hypervisor as shipped with Red Hat Enterprise Linux 5. A kernel-xen update for Red Hat Enterprise Linux 5 is available to address this flaw.

Comment 24 Mark J. Cox 2012-05-02 08:01:22 UTC
CERT contacted us and moved the embargo to 1st June 2012.  

VU#649219

Comment 26 Mark J. Cox 2012-05-03 09:55:02 UTC
CERT contacted us and moved the embargo to 12th June 2012

Comment 30 Jan Lieskovsky 2012-06-12 12:07:20 UTC
Public via:
http://www.openwall.com/lists/oss-security/2012/06/12/1

Comment 31 errata-xmlrpc 2012-06-12 14:56:00 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5.6 EUS - Server Only

Via RHSA-2012:0720 https://rhn.redhat.com/errata/RHSA-2012-0720.html

Comment 32 errata-xmlrpc 2012-06-12 14:56:11 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2012:0721 https://rhn.redhat.com/errata/RHSA-2012-0721.html

Comment 33 Kirill Korotaev 2012-06-13 08:08:52 UTC
Is RHEL4 vulnerable? (it's still under Extended LifeCycle support).

Comment 34 Paolo Bonzini 2012-06-13 09:02:26 UTC
RHEL4 does not include the Xen hypervisor.

Comment 35 Petr Matousek 2012-06-13 09:20:28 UTC
(In reply to comment #33)
> Is RHEL4 vulnerable? (it's still under Extended LifeCycle support).

Not vulnerable.

As of Xen specific aspects of this flaw, Red Hat Enterprise Linux 4 does not include the Xen hypervisor.

Red Hat Enterprise Linux 4 has reduced task size (511 GB) that is less than the size of lower half of canonical area (current 48-bit implementation) so it does not need the fix for CVE-2005-1764 (that introduces the guard page between end of lower half canonical area and start of non-canonical area). Red Hat Enterprise Linux 4 also contains the fix for CVE-2006-0744, which addresses known attacks that used non-canonical ELF/signal entry points.

Comment 36 Vincent Danen 2012-06-15 14:52:43 UTC
IssueDescription:

It was found that the Xen hypervisor implementation as shipped with Red Hat Enterprise Linux 5 did not properly restrict the syscall return addresses in the sysret return path to canonical addresses. An unprivileged user in a 64-bit para-virtualized guest, that is running on a 64-bit host that has an Intel CPU, could use this flaw to crash the host or, potentially, escalate their privileges, allowing them to execute arbitrary code at the hypervisor level.

Comment 37 Petr Matousek 2012-09-05 11:22:00 UTC
VUPEN Blog post about the vulnerability:

http://www.vupen.com/blog/20120904.Advanced_Exploitation_of_Xen_Sysret_VM_Escape_CVE-2012-0217.php


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