Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42562
b: refs/heads/master
c: f81cff0
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Dec 6, 2006
1 parent 4a8aafe commit 510ea13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3363c9b0ed8f6b5a241d63018cad242ae458cdf9
refs/heads/master: f81cff0d4067e41fd7383d9c013cc82da7c169d2
12 changes: 7 additions & 5 deletions trunk/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,17 @@ static int validate_mmap_request(struct file *file,
(flags & MAP_TYPE) != MAP_SHARED)
return -EINVAL;

if (PAGE_ALIGN(len) == 0)
return addr;

if (len > TASK_SIZE)
if (!len)
return -EINVAL;

/* Careful about overflows.. */
len = PAGE_ALIGN(len);
if (!len || len > TASK_SIZE)
return -ENOMEM;

/* offset overflow? */
if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
return -EINVAL;
return -EOVERFLOW;

if (file) {
/* validate file mapping requests */
Expand Down

0 comments on commit 510ea13

Please sign in to comment.