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:
parent
0ecd7516de
commit
bc35a6e445
@ -941,6 +941,8 @@ map_backing_store(VMAddressSpace* addressSpace, VMCache* cache, off_t offset,
|
||||
#endif
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
if (offset < 0)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
uint32 allocationFlags = HEAP_DONT_WAIT_FOR_MEMORY
|
||||
| HEAP_DONT_LOCK_KERNEL_SPACE;
|
||||
|
Loading…
Reference in New Issue
Block a user