LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] splice: fix user pointer access in get_iovec_page_array()
@ 2008-02-10 14:47 Pekka J Enberg
  2008-02-10 15:17 ` Bastian Blank
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Pekka J Enberg @ 2008-02-10 14:47 UTC (permalink / raw)
  To: torvalds
  Cc: linux-kernel, stable, jens.axboe, akpm, bastian, ndenev, oliver.pntr

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>
---
Bastian, can I have your Signed-off-by for this, please? Oliver, Niki, can 
you please confirm this closes the hole?

 fs/splice.c |    3 +++
 1 file changed, 3 insertions(+)

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-02-11  8:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-10 14:47 [PATCH] splice: fix user pointer access in get_iovec_page_array() Pekka J Enberg
2008-02-10 15:17 ` Bastian Blank
2008-02-10 15:31   ` Oliver Pinter
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

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).