[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070201103011.69ebafc8@frecb000686>
Date: Thu, 1 Feb 2007 10:30:11 +0100
From: Sébastien Dugué <sebastien.dugue@...l.net>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Andrew Morton <akpm@...l.org>, linux-aio <linux-aio@...ck.org>,
Bharata B Rao <bharata@...ibm.com>,
Christoph Hellwig <hch@...radead.org>,
Suparna Bhattacharya <suparna@...ibm.com>,
Ulrich Drepper <drepper@...hat.com>,
Zach Brown <zach.brown@...cle.com>,
Oleg Nesterov <oleg@...sign.ru>,
Badari Pulavarty <pbadari@...ibm.com>,
Benjamin LaHaise <bcrl@...ux.intel.com>,
Jean Pierre Dion <jean-pierre.dion@...l.net>
Subject: [PATCH -mm 3/7][AIO] - Fix access_ok() checks
From: Sébastien Dugué <sebastien.dugue@...l.net>
Fix access_ok() checks in sys_io_submit() and
compat_sys_io_submit()
sys_io_submit() and compat_sys_io_submit() check for the number of
requests (nr) being positive, but the following access_ok() call uses
nr * sizeof(ptr) which can overlow to a negative number.
Just make sure that nr * sizeof(ptr) is positive in the first place.
aio.c | 2 +-
compat.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Signed-off-by: Sébastien Dugué <sebastien.dugue@...l.net>
Index: linux-2.6.20-rc6-mm3/fs/aio.c
===================================================================
--- linux-2.6.20-rc6-mm3.orig/fs/aio.c 2007-01-30 11:28:56.000000000 +0100
+++ linux-2.6.20-rc6-mm3/fs/aio.c 2007-01-30 11:32:42.000000000 +0100
@@ -1630,7 +1630,7 @@ asmlinkage long sys_io_submit(aio_contex
long ret = 0;
int i;
- if (unlikely(nr < 0))
+ if (unlikely((nr*sizeof(*iocbpp)) < 0))
return -EINVAL;
if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(*iocbpp)))))
Index: linux-2.6.20-rc6-mm3/fs/compat.c
===================================================================
--- linux-2.6.20-rc6-mm3.orig/fs/compat.c 2007-01-30 11:30:29.000000000 +0100
+++ linux-2.6.20-rc6-mm3/fs/compat.c 2007-01-30 11:31:55.000000000 +0100
@@ -651,7 +651,7 @@ compat_sys_io_submit(aio_context_t ctx_i
long ret = 0;
int i;
- if (unlikely(nr < 0))
+ if (unlikely((nr * sizeof(u32)) < 0))
return -EINVAL;
if (unlikely(!access_ok(VERIFY_READ, iocb, (nr * sizeof(u32)))))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists