mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 08:10:54 +07:00
switch do_brk() to get_unmapped_area()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
9206de95b1
commit
2c6a10161d
10
mm/mmap.c
10
mm/mmap.c
@ -1985,20 +1985,14 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
|
||||
if (!len)
|
||||
return addr;
|
||||
|
||||
if ((addr + len) > TASK_SIZE || (addr + len) < addr)
|
||||
return -EINVAL;
|
||||
|
||||
if (is_hugepage_only_range(mm, addr, len))
|
||||
return -EINVAL;
|
||||
|
||||
error = security_file_mmap(NULL, 0, 0, 0, addr, 1);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
|
||||
|
||||
error = arch_mmap_check(addr, len, flags);
|
||||
if (error)
|
||||
error = get_unmapped_area(NULL, addr, len, 0, MAP_FIXED);
|
||||
if (error & ~PAGE_MASK)
|
||||
return error;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user