Fixed various bugs in user buffer validation/mapping and mmap() syscall path.

This commit is contained in:
Bahadir Balban
2008-11-07 12:32:10 +02:00
parent ca8959eee0
commit 3cb36b632a
5 changed files with 18 additions and 22 deletions

View File

@@ -615,7 +615,7 @@ int sys_read(struct tcb *task, int fd, void *buf, int count)
/* Check user buffer validity. */
if ((ret = pager_validate_user_range(task, buf,
(unsigned long)(buf + count),
(unsigned long)count,
VM_READ)) < 0)
return -EFAULT;
@@ -685,7 +685,7 @@ int sys_write(struct tcb *task, int fd, void *buf, int count)
/* Check user buffer validity. */
if ((ret = pager_validate_user_range(task, buf,
(unsigned long)(buf + count),
(unsigned long)count,
VM_WRITE | VM_READ)) < 0)
return -EINVAL;