]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Fix fadvise() parameter checking
authorAndrew Morton <akpm@osdl.org>
Fri, 13 Feb 2004 07:47:21 +0000 (23:47 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 13 Feb 2004 07:47:21 +0000 (23:47 -0800)
From: Ulrich Drepper <drepper@redhat.com>

The len parameter for fadvise has a signed type and negative values passed
must be rejected.  The attached patch does the job.

mm/fadvise.c

index 40b40b0be3e96f69bda6ca87c7e6faf8d1dcf983..d20bf2a93064ef8f2972c12313295fc4aab07286 100644 (file)
@@ -33,7 +33,7 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
                return -EBADF;
 
        mapping = file->f_mapping;
-       if (!mapping) {
+       if (!mapping || len < 0) {
                ret = -EINVAL;
                goto out;
        }