mmap: validate hint

This commit is contained in:
Matheus
2026-04-06 17:44:06 -03:00
parent 4a28a7595d
commit ad127fe0d0
+5
View File
@@ -34,6 +34,11 @@ syscallret_t syscall_mmap(context_t *context, void *hint, size_t len, int prot,
return ret;
}
if (!IS_USER_ADDRESS(hint)) {
ret.errno = EINVAL;
return ret;
}
if ((flags & MAP_PRIVATE) && (flags & MAP_SHARED)) {
ret.errno = EINVAL;
return ret;