Linux Kernel 3.11-rc ARM/perf priviledge escalation

2013-08-15 / 2013-08-17
Credit: Vince Weaver
Risk: High
Local: Yes
Remote: No
CWE: CWE-20


CVSS Base Score: 6.9/10
Impact Subscore: 10/10
Exploitability Subscore: 3.4/10
Exploit range: Local
Attack complexity: Medium
Authentication: No required
Confidentiality impact: Complete
Integrity impact: Complete
Availability impact: Complete

I'm not really a security researcher, so hopefully I'm reporting this in the proper way. I have a fuzzer tool for the perf_event_open() syscall that found a few oopses on the ARM platform, which I reported to lkml a week ago. One of the oopses can lead to a local privilege escalation on ARM-perf. This fix can be found here: http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7809/1 The discussion thread is: https://lkml.org/lkml/2013/8/7/259 The hope is this appears in 3.11-rc6 but my attempts to get the people at security () vger kernel org to take this seriously didn't really go very well. I do have code that will exploit the kernel and give me a root shell on an ARM Pandaboard machine running 3.11-rc4. The exploit is a bit fragile though: + Only works on ARM + Elevates from normal user to root, no special config required. perf_event syscalls run as regular users, not sure why some think you need root. + It does need a user-mappable address at an exact byte offset from a pmu_struct in memory. This limits things somewhat; in my testing 3.11-rc kernels have INT_MIN at exactly the right place but the exploit doesn't work on a 3.7.6 kernel, it just oopses or crashes the machine. diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index d9f5cd4..0500f10b 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c @@ -253,6 +253,9 @@ validate_event(struct pmu_hw_events *hw_events, struct arm_pmu *armpmu = to_arm_pmu(event->pmu); struct pmu *leader_pmu = event->group_leader->pmu; + if (is_software_event(event)) + return 1; + if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF) return 1;

References:

https://lkml.org/lkml/2013/8/7/259
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7809/1
http://seclists.org/oss-sec/2013/q3/406


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top