public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: spender@grsecurity.net (Brad Spengler)
To: Arjan van de Ven <arjan@infradead.org>
Cc: Eric Paris <eparis@redhat.com>,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov,
	sds@tycho.nsa.gov, jmorris@namei.org, dwalsh@redhat.com,
	cl@linux-foundation.org, alan@lxorguk.ukuu.org.uk
Subject: Re: mmap_min_addr and your local LSM (ok, just SELinux)
Date: Tue, 21 Jul 2009 07:51:50 -0400	[thread overview]
Message-ID: <20090721115150.GB6978@grsecurity.net> (raw)
In-Reply-To: <20090720204848.5f37c92a@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

> one option is to allow the page to be mapped, but only as
> non-executable... in DOS that memory isn't where code lives anyway...

Bad idea.

My exploit (and many other null ptr dereference exploits) still will
work with a non-executable NULL mapping.  The exploit I released was
different from the one I did in 2007 in that in 2007 I abused a function
pointer in the structure that was being pointed to and located at NULL.
In this case, no function pointers were used at all in the structure
being pointed to.  I turned a 'trojaned data' situation into an
arbitrary OR of 0x1 and then into arbitrary code execution.

For instance, if I targeted the 3rd byte in the mmap file_operation
fptr, that would have given me a target userland address of 0x10000.
If I targeted the 4th byte, it would have given me 0x1000000, neither of
which fall under mmap_min_addr protection

Furthermore, without an actual NX implementation enforcing the lack of
PROT_EXEC, the kernel will execute in the region just fine.

-Brad

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2009-07-21 12:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-20 23:23 mmap_min_addr and your local LSM (ok, just SELinux) Eric Paris
2009-07-21  0:14 ` Christopher Pardy
2009-07-21 13:41   ` Daniel J Walsh
2009-07-21  3:45 ` James Morris
2009-07-21 14:44   ` James Carter
2009-07-22 10:06     ` James Morris
2009-07-28  0:19       ` Alan Cox
2009-07-28  3:28         ` Kyle Moffett
2009-07-28  9:21         ` Andi Kleen
2009-07-28 10:00           ` Alan Cox
2009-07-28 11:21             ` Andi Kleen
2009-07-28 13:35               ` Brad Spengler
2009-07-28 14:48                 ` Andi Kleen
2009-07-28 15:56           ` Kees Cook
2009-07-28 16:23             ` Andi Kleen
2009-07-21  3:48 ` Arjan van de Ven
2009-07-21 11:51   ` Brad Spengler [this message]
2009-07-21  4:13 ` Kyle McMartin
2009-07-21 11:31   ` Arnd Bergmann
2009-07-30  9:06 ` Pavel Machek

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=20090721115150.GB6978@grsecurity.net \
    --to=spender@grsecurity.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=cl@linux-foundation.org \
    --cc=dwalsh@redhat.com \
    --cc=eparis@redhat.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox