mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Niki Denev" <ndenev@gmail.com>
To: "Willy Tarreau" <w@1wt.eu>
Cc: linux-kernel@vger.kernel.org, jens.axboe@oracle.com
Subject: Re: [PATCH] kernel 2.6.24.1 still vulnerable to the vmsplice local root exploit
Date: Sun, 10 Feb 2008 04:40:53 -0500	[thread overview]
Message-ID: <2e77fc10802100140q5c8adfb4k7db88d48cbd5f8b2@mail.gmail.com> (raw)
In-Reply-To: <2e77fc10802092238k13efb111ifcd298daaf7b4aba@mail.gmail.com>

On Feb 10, 2008 1:38 AM, Niki Denev <ndenev@gmail.com> wrote:
>
> On Feb 10, 2008 8:32 AM, Willy Tarreau <w@1wt.eu> wrote:
> > On Sun, Feb 10, 2008 at 08:04:35AM +0200, Niki Denev wrote:
> > > Hi,
> > >
> > > As the subject says the 2.6.24.1 is still vulnerable to the vmsplice
> > > local root exploit.
> >
> > Yes indeed, that's quite bad. 2.6.24-git is still vulnerable too, and
> > also contains the fix :-(
> >
> > CC'd Jens as he worked on the fix.
> >
> > Willy
> >
> >
>
> I was unable to gain root on 2.6.24-git20
> but after several segfaults when executing the exploit continously
> the machine crashes.
>
> --Niki
>

this fixed the problem for me (kernel 2.6.24.1) :
It appears that the initial patch checked the input to vmsplice_to_user,
but the exploit used vmsplice_to_pipe which remained open to the attack.

--- fs/splice.c.orig	2008-02-08 21:55:30.000000000 +0200
+++ fs/splice.c	2008-02-10 11:32:50.000000000 +0200
@@ -1443,6 +1443,10 @@
 	struct pipe_inode_info *pipe;
 	struct page *pages[PIPE_BUFFERS];
 	struct partial_page partial[PIPE_BUFFERS];
+	int error;
+	long ret;
+	void __user *base;
+	size_t len;
 	struct splice_pipe_desc spd = {
 		.pages = pages,
 		.partial = partial,
@@ -1450,6 +1454,31 @@
 		.ops = &user_page_pipe_buf_ops,
 	};

+	error = ret = 0;
+
+	/*
+	 * Get user address base and length for this iovec.
+	 */
+	error = get_user(base, &iov->iov_base);
+	if (unlikely(error))
+		return error;
+	error = get_user(len, &iov->iov_len);
+	if (unlikely(error))
+		return error;
+
+	/*
+	 * Sanity check this iovec. 0 read succeeds.
+	 */
+	if (unlikely(!len))
+		return 0;
+	if (unlikely(!base)) {
+		return -EFAULT;	
+	}
+
+	if (unlikely(!access_ok(VERIFY_WRITE, base, len))) {
+		return -EFAULT;
+	}
+
 	pipe = pipe_info(file->f_path.dentry->d_inode);
 	if (!pipe)
 		return -EBADF;

  reply	other threads:[~2008-02-10  9:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10  6:04 Niki Denev
2008-02-10  6:32 ` Willy Tarreau
2008-02-10  6:38   ` Niki Denev
2008-02-10  9:40     ` Niki Denev [this message]
2008-02-10 12:04       ` [PATCH] " Oliver Pinter
2008-02-10 12:22       ` Bastian Blank
2008-02-10 12:39         ` Niki Denev
2008-02-10 12:47           ` Bastian Blank
2008-02-10 12:54             ` Niki Denev
2008-02-10 13:02             ` Oliver Pinter
2008-02-10 17:05               ` [stable] " Greg KH
2008-02-10 17:11                 ` Pekka Enberg
2008-02-10 17:44                 ` Oliver Pinter
2008-02-10 17:48                 ` Oliver Pinter
2008-02-10 13:48         ` Niki Denev

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=2e77fc10802100140q5c8adfb4k7db88d48cbd5f8b2@mail.gmail.com \
    --to=ndenev@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    /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

all inboxes | Powered by JetHome®