kernel/vm: Prohibit offset from being < 0 in mmap.
POSIX seems to be silent about whether this is permitted, but at least FreeBSD explicitly does not allow it. Fixes #16936. Change-Id: If6b23410ae88245e706df77d276234f4775654f9
This commit is contained in:
@@ -941,6 +941,8 @@ map_backing_store(VMAddressSpace* addressSpace, VMCache* cache, off_t offset,
|
|||||||
#endif
|
#endif
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
if (offset < 0)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
uint32 allocationFlags = HEAP_DONT_WAIT_FOR_MEMORY
|
uint32 allocationFlags = HEAP_DONT_WAIT_FOR_MEMORY
|
||||||
| HEAP_DONT_LOCK_KERNEL_SPACE;
|
| HEAP_DONT_LOCK_KERNEL_SPACE;
|
||||||
|
|||||||
Reference in New Issue
Block a user