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.
--
| Bruce Leonard | [PATCH 2/2][MTD] Add support for > 2GiB MTD devices |
| Benjamin Herrenschmidt | Re: [PATCH 0 of 4] Generic AIO by scheduling stacks |
| Rafael J. Wysocki | [Bug #11264] Invalid op opcode in kernel/workqueue |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Elijah Newren | Trying to use git-filter-branch to compress history by removing large, obsolete bi... |
| David Woodhouse | Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins |
| Florian Weimer | Re: comparing file contents in is_exact_match? |
| sean | Adding color to git diff output. |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| David Newman | setting dscp or tos bits |
| Richard Stallman | Real men don't attack straw men |
| alemao | Azalia - Realtek/0x0885 - plays, but no sound |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Doug Evans | Re: Stabilizing Linux |
| Stephen Tweedie | Re: No utmp entry. You must exec "login" from lowest level "sh" |
| Maurizio Codogno | SLS 0.99.2 mount problems |
