Skip to content

Commit

Permalink
userns; Correct the comment in map_write
Browse files Browse the repository at this point in the history
It is important that all maps are less than PAGE_SIZE
or else setting the last byte of the buffer to '0'
could write off the end of the allocated storage.

Correct the misleading comment.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Dec 12, 2014
1 parent 66d2f33 commit 36476be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/user_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ static ssize_t map_write(struct file *file, const char __user *buf,
if (!page)
goto out;

/* Only allow <= page size writes at the beginning of the file */
/* Only allow < page size writes at the beginning of the file */
ret = -EINVAL;
if ((*ppos != 0) || (count >= PAGE_SIZE))
goto out;
Expand Down

0 comments on commit 36476be

Please sign in to comment.