Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74502 - Fix int $0x80 handler on x86-64 CAN-2004-1144 (Vendor-Sec)
Summary: Fix int $0x80 handler on x86-64 CAN-2004-1144 (Vendor-Sec)
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Kernel (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard: 221204 12:00 GMT
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-15 07:24 UTC by Sune Kloppenborg Jeppesen (RETIRED)
Modified: 2006-12-27 01:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-12-15 07:24:04 UTC
Reported on Vendor-Sec

Hello,
  in my recent work I noticed that you can force x86-64 kernel to execute arbitrary code
at CPL0 by just issuing int $0x80 with properly prepared %rax register - ia32 handler
checks %eax only, but uses %rax while accessing syscall table.  By mapping memory at
user accessible address at address of syscall table + k*32GB and then issuing int $0x80
with %rax set to 1 + k*4G kernel will jump at CPL0 at address you (userspace) specified,
causing execution of untrusted code at CPL0.

  Note that using 32bit userspace does not prevent this bug from being exploited, any user
process can switch to 64bit mode and load %rax with any value it wants.

  2.6.x kernels are immune to this, as they have this mov in place for almost two years.
                                                                Thanks,
                                                                        Petr Vandrovec


Signed-off-by: Petr Vandrovec <vandrove@vc.cvut.cz>

--- linux-2.4.28/arch/x86_64/ia32/ia32entry.S.orig      2004-08-08 01:26:04.000000000 +0200
+++ linux-2.4.28/arch/x86_64/ia32/ia32entry.S   2004-12-06 21:36:06.000000000 +0100
@@ -52,6 +52,7 @@
 ENTRY(ia32_syscall)
        swapgs  
        sti
+       mov %eax,%eax
        pushq %rax
        cld
        SAVE_ARGS
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2004-12-18 09:54:53 UTC
AMD64 doesn't support 2.6 kernels or recommend them in any fashion so I don't see if we should even bother with this one as it's 2.4 only...
Comment 2 Thierry Carrez (RETIRED) gentoo-dev 2004-12-19 05:45:11 UTC
If this affects only amd64 (not ia64 or whatever) I agree to close it as WONTFIX.
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2004-12-19 10:01:48 UTC
Yeah, this is AMD64 only. Closing as INVALID; see comment #1...