Bug 885460 (CVE-2014-3534) - VUL-0: CVE-2014-3534: kernel: s390x local privilege escalation via ptrace
Summary: VUL-0: CVE-2014-3534: kernel: s390x local privilege escalation via ptrace
Status: VERIFIED FIXED
Alias: CVE-2014-3534
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: S/390-64 Linux
: P3 - Medium : Major
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-02 12:25 UTC by Marcus Meissner
Modified: 2016-04-28 07:16 UTC (History)
6 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
s390-sles12-ptrace-poke-exploit.patch (2.08 KB, patch)
2014-07-02 14:24 UTC, Marcus Meissner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Meissner 2014-07-02 12:25:22 UTC
EMBARGOED, reported via IBM

Description:  kernel: ptrace local root exploit
Symptom:      Privilege escalation by a non-priviledged user space program.
Problem:      The PSW mask check of the PTRACE_POKEUSR_AREA command is
              incorrect. The PSW_MASK_USER define contains the PSW_MASK_ASC
              bits, the ptrace interface accepts all combinations for the
              address-space-control bits.
Solution:     To protect the kernel space the PSW mask check in ptrace
              needs to reject the address-space-control bit combination
              for the kernel space.
Reproduction: Use gdb to modify the PSW of the inferior to point to the
              home space and let the inferior continue with a write
              instruction to a kernel address.

(See attached file: s390-sles12-ptrace-poke-exploit.patch)
Comment 1 Marcus Meissner 2014-07-02 14:24:32 UTC
Created attachment 597021 [details]
s390-sles12-ptrace-poke-exploit.patch

attached patch from Geralds mail
Comment 2 Marcus Meissner 2014-07-02 14:28:15 UTC
CRD is still open, for around RC2 according to Gerald.
Comment 3 SMASH SMASH 2014-07-02 14:45:13 UTC
Affected packages:

SLE-10-SP3-TERADATA: kernel-default
SLE-11-SP1-TERADATA: kernel-default
SLE-11-SP3: kernel-default
SLE-11-SP3-PRODUCTS: kernel-default
SLE-11-SP3-UPTU: kernel-default
Comment 4 Gerald Schaefer 2014-07-02 14:50:28 UTC
This affects SLES 12 only. SLES 10 / 11 is missing some prerequisite patches, which are neccessary to allow this exploit.
Comment 5 Gerald Schaefer 2014-07-02 15:04:07 UTC
fyi, the following git commit introduced the issue (only included in SLES 12):

commit fa968ee215c0ca91e4a9c3a69ac2405aae6e5d2f
Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
Date:   Wed Nov 7 10:44:08 2012 +0100

    s390/signal: set correct address space control
    
    If user space is running in primary mode it can switch to secondary
    or access register mode, this is used e.g. in the clock_gettime code
    of the vdso. If a signal is delivered to the user space process while
    it has been running in access register mode the signal handler is
    executed in access register mode as well which will result in a crash
    most of the time.
    
    Set the address space control bits in the PSW to the default for the
    execution of the signal handler and make sure that the previous
    address space control is restored on signal return. Take care
    that user space can not switch to the kernel address space by
    modifying the registers in the signal frame.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Comment 6 Swamp Workflow Management 2014-07-02 22:00:20 UTC
bugbot adjusting priority
Comment 8 Marcus Meissner 2014-07-22 11:12:23 UTC
In mainline linux kernel git.

commit dab6cf55f81a6e16b8147aed9a843e1691dcd318
Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
Date:   Mon Jun 23 15:29:40 2014 +0200

    s390/ptrace: fix PSW mask check
    
    The PSW mask check of the PTRACE_POKEUSR_AREA command is incorrect.
    The PSW_MASK_USER define contains the PSW_MASK_ASC bits, the ptrace
    interface accepts all combinations for the address-space-control
    bits. To protect the kernel space the PSW mask check in ptrace needs
    to reject the address-space-control bit combination for home space.
    
    Fixes CVE-2014-3534
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Comment 9 Gerald Schaefer 2014-07-22 14:27:05 UTC
Yes, looks like Martin acted a little overhasty there. Anyway, I guess this ends any embargo, so you can now include the patch for the next SLES 12 Beta/RC update.
Comment 10 John Jolly 2014-08-18 20:26:50 UTC
This patch has been submitted, although I do not believe the patch made it in time for RC2.
Comment 11 John Jolly 2014-08-18 20:27:18 UTC
To be clear, I submitted this patch to SLE12
Comment 12 Alexander Bergmann 2014-08-19 11:05:15 UTC
I'm closing this as fixed as this affects only SLE-12 on s390x.