mirror of
https://github.com/drasko/codezero.git
synced 2026-04-03 10:39:04 +02:00
Fixed various bugs in user buffer validation/mapping and mmap() syscall path.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user