mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
mmap: validate hint
This commit is contained in:
@@ -34,6 +34,11 @@ syscallret_t syscall_mmap(context_t *context, void *hint, size_t len, int prot,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!IS_USER_ADDRESS(hint)) {
|
||||||
|
ret.errno = EINVAL;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if ((flags & MAP_PRIVATE) && (flags & MAP_SHARED)) {
|
if ((flags & MAP_PRIVATE) && (flags & MAP_SHARED)) {
|
||||||
ret.errno = EINVAL;
|
ret.errno = EINVAL;
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user