From: Marcelo Tosatti <mtosatti@redhat.com>
To: Antoine Martin <antoine@nagafix.co.uk>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Roland McGrath <roland@redhat.com>,
Jan Kiszka <jan.kiszka@web.de>
Subject: Re: kvm ptrace 32bit DoS bug - bisected
Date: Sat, 5 Sep 2009 17:43:37 -0300 [thread overview]
Message-ID: <20090905204336.GA6991@amt.cnet> (raw)
In-Reply-To: <4AA26A86.8060908@nagafix.co.uk>
On Sat, Sep 05, 2009 at 08:41:26PM +0700, Antoine Martin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Hi,
>
> I reported this bug a while ago but no-one picked up on it.
> Just launch any UML 32-bit kernel on a 64-bit KVM guest:
>
> test $ ./kernel32-2.6.16.62
> Checking that ptrace can change system call numbers...OK
> Checking syscall emulation patch for ptrace...OK
> Trace/breakpoint trap
> test@localhost ~ $ Kernel panic - not syncing: Attempted to kill init!
> Kernel panic - not syncing: Attempted to kill init!
>
>
> You can find some pre-built binaries here:
> http://uml.devloop.org.uk/kernels.html
>
> Since then, I've bisected it down to:
> d4d67150165df8bf1cc05e532f6efca96f907cab is first bad commit
> Author: Roland McGrath <roland@redhat.com>
> Date: Wed Jul 9 02:38:07 2008 -0700
> Subject: x86 ptrace: unify syscall tracing
>
> It looks exploitable at first sight (ptrace generally is), but this is
> beyond me (I am not a kernel hacker)
>
> QEMU without KVM is not affected.
>
> I've added some printf in a test UML kernel to see more precisely where
> it dies in arch/um/os-Linux/startup.c: in check_sysemu():
> non_fatal("Before singlestep\n");
> if (ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
> goto fail;
> non_fatal("Before waitpid\n");
> (also added a non_fatal() in fail)
>
> It prints these two statements 30 times from the while(1) loop and stops on:
> Before singlestep
>
> Whatever the fix is, this should be queued for stable too.
Is this an AMD host?
Works for me on Intel:
[root@guest ~]# ./kernel32-2.6.29.6
Locating the bottom of the address space ... 0x0
Locating the top of the address space ... 0xffffd000
Core dump limits :
soft - 0
hard - NONE
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...OK
Checking advanced syscall emulation patch for ptrace...OK
Checking for tmpfs mount on /dev/shm...OK
Checking PROT_EXEC mmap in /dev/shm/...OK
Checking for the skas3 patch in the host:
- /proc/mm...not found: No such file or directory
- PTRACE_FAULTINFO...not found
- PTRACE_LDT...not found
UML running in SKAS0 mode
[ 0.000000] Linux version 2.6.29.6 (root@virtual.nagafix.co.uk) (gcc
version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) ) #1 Wed Jul 29
08:29:46 BST 2009
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 8128
[ 0.000000] Kernel command line: root=98:0
next prev parent reply other threads:[~2009-09-05 20:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-05 13:41 kvm ptrace 32bit DoS bug - bisected Antoine Martin
2009-09-05 20:43 ` Marcelo Tosatti [this message]
2009-09-06 7:37 ` Antoine Martin
2009-09-06 7:50 ` Antoine Martin
2009-09-08 16:33 ` Marcelo Tosatti
2009-09-08 16:53 ` Jan Kiszka
2009-10-17 13:24 ` Antoine Martin
2009-10-18 6:50 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090905204336.GA6991@amt.cnet \
--to=mtosatti@redhat.com \
--cc=antoine@nagafix.co.uk \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=roland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.