Commit e0fc5036 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix fadvise() parameter checking

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.
parent 4ddb0339
...@@ -33,7 +33,7 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice) ...@@ -33,7 +33,7 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
return -EBADF; return -EBADF;
mapping = file->f_mapping; mapping = file->f_mapping;
if (!mapping) { if (!mapping || len < 0) {
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment