]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-vmsplice.patch
- updated for 2.6.25.4
[packages/kernel.git] / kernel-vmsplice.patch
1 commit 712a30e63c8066ed84385b12edbfb804f49cbc44
2 Author: Bastian Blank <bastian@waldi.eu.org>
3 Date:   Sun Feb 10 16:47:57 2008 +0200
4
5     splice: fix user pointer access in get_iovec_page_array()
6     
7     Commit 8811930dc74a503415b35c4a79d14fb0b408a361 ("splice: missing user
8     pointer access verification") added the proper access_ok() calls to
9     copy_from_user_mmap_sem() which ensures we can copy the struct iovecs
10     from userspace to the kernel.
11     
12     But we also must check whether we can access the actual memory region
13     pointed to by the struct iovec to fix the access checks properly.
14     
15     Signed-off-by: Bastian Blank <waldi@debian.org>
16     Acked-by: Oliver Pinter <oliver.pntr@gmail.com>
17     Cc: Jens Axboe <jens.axboe@oracle.com>
18     Cc: Andrew Morton <akpm@linux-foundation.org>
19     Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
20     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
21
22 diff --git a/fs/splice.c b/fs/splice.c
23 index 14e2262..9b559ee 100644
24 --- a/fs/splice.c
25 +++ b/fs/splice.c
26 @@ -1234,7 +1234,7 @@ static int get_iovec_page_array(const struct iovec __user *iov,
27                 if (unlikely(!len))
28                         break;
29                 error = -EFAULT;
30 -               if (unlikely(!base))
31 +               if (!access_ok(VERIFY_READ, base, len))
32                         break;
33  
34                 /*
This page took 0.026898 seconds and 3 git commands to generate.