LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Oliver Pinter" <oliver.pntr@gmail.com>
To: "Bastian Blank" <bastian@waldi.eu.org>,
	"Pekka J Enberg" <penberg@cs.helsinki.fi>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	stable@kernel.org, jens.axboe@oracle.com,
	akpm@linux-foundation.org, ndenev@gmail.com,
	oliver.pntr@gmail.com
Subject: Re: [PATCH] splice: fix user pointer access in get_iovec_page_array()
Date: Sun, 10 Feb 2008 16:31:10 +0100	[thread overview]
Message-ID: <6101e8c40802100731r4c90834fy2186e28dffc0a1c3@mail.gmail.com> (raw)
In-Reply-To: <20080210151735.GA2810@wavehammer.waldi.eu.org>

Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>

----8<----

Linux pancs 2.6.22.17-opt2-cve2 #1 SMP Sun Feb 10 16:22:37 CET 2008
i686 GNU/Linux
-----------------------------------
 Linux vmsplice Local Root Exploit
 By qaaz
-----------------------------------
[+] mmap: 0x0 .. 0x1000
[+] page: 0x0
[+] page: 0x20
[+] mmap: 0x4000 .. 0x5000
[+] page: 0x4000
[+] page: 0x4020
[+] mmap: 0x1000 .. 0x2000
[+] page: 0x1000
[+] mmap: 0xb7f2d000 .. 0xb7f5f000
[-] vmsplice: Bad address

-----

oliver@pancs:/tmp$ uname -a && ./2623_2624_root_exploit
Linux pancs 2.6.22.17-opt2-cve2 #1 SMP Sun Feb 10 16:22:37 CET 2008
i686 GNU/Linux
-----------------------------------
 Linux vmsplice Local Root Exploit
 By qaaz
-----------------------------------
[+] addr: 0xc01112e9
[-] wtf


---->8----
On 2/10/08, Bastian Blank <bastian@waldi.eu.org> wrote:
> On Sun, Feb 10, 2008 at 04:47:57PM +0200, Pekka J Enberg wrote:
> > From: Bastian Blank <bastian@waldi.eu.org>
> >
> > The commit 8811930dc74a503415b35c4a79d14fb0b408a361 ("splice: missing user
> > pointer access verification") added access_ok() to
> copy_from_user_mmap_sem()
> > which only ensures we can copy the struct iovecs from userspace to the
> kernel
> > but we also must check whether we can access the actual memory region
> pointed
> > to by the struct iovec to close the local root exploit.
> >
> > Cc: <stable@kernel.org>
> > Cc: Jens Axboe <jens.axboe@oracle.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
> Signed-off-by: Bastian Blank <waldi@debian.org>
>
> > Index: linux-2.6/fs/splice.c
> > ===================================================================
> > --- linux-2.6.orig/fs/splice.c
> > +++ linux-2.6/fs/splice.c
> > @@ -1237,6 +1237,9 @@ static int get_iovec_page_array(const st
> >  		if (unlikely(!base))
> >  			break;
> >
> > +		if (unlikely(!access_ok(VERIFY_READ, base, len)))
> > +			break;
> > +
> >  		/*
> >  		 * Get this base offset and number of pages, then map
> >  		 * in the user pages.
>
> --
> Those who hate and fight must stop themselves -- otherwise it is not
> stopped.
> 		-- Spock, "Day of the Dove", stardate unknown
>


-- 
Thanks,
Oliver

  reply	other threads:[~2008-02-10 15:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10 14:47 Pekka J Enberg
2008-02-10 15:17 ` Bastian Blank
2008-02-10 15:31   ` Oliver Pinter [this message]
2008-02-10 23:37 ` Willy Tarreau
2008-02-11  6:24   ` Oliver Pinter
2008-02-11  7:29 ` [PATCH] vmsplice exploit fix (was: splice: fix user pointer access in get_iovec_page_array) Daniel Phillips
2008-02-11  7:49   ` Pekka Enberg
2008-02-11  8:00     ` Daniel Phillips
2008-02-11  7:53   ` [stable] " Greg KH
2008-02-11  8:05     ` Daniel Phillips

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=6101e8c40802100731r4c90834fy2186e28dffc0a1c3@mail.gmail.com \
    --to=oliver.pntr@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bastian@waldi.eu.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndenev@gmail.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [PATCH] splice: fix user pointer access in get_iovec_page_array()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).