mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03:00
Kernel: mmap() with both MAP_PRIVATE and MAP_SHARED is an error
This commit is contained in:
parent
c58d1868cb
commit
3d4ed7f38d
Notes:
sideshowbarker
2024-07-19 11:51:57 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3d4ed7f38de
@ -206,6 +206,8 @@ void* Process::sys$mmap(const Syscall::SC_mmap_params* params)
|
||||
return (void*)-EINVAL;
|
||||
if ((u32)addr & ~PAGE_MASK)
|
||||
return (void*)-EINVAL;
|
||||
if ((flags & MAP_SHARED) && (flags & MAP_PRIVATE))
|
||||
return (void*)-EINVAL;
|
||||
if (flags & MAP_ANONYMOUS) {
|
||||
auto* region = allocate_region(VirtualAddress((u32)addr), size, name ? name : "mmap", prot, false);
|
||||
if (!region)
|
||||
|
Loading…
Reference in New Issue
Block a user