reserve_user_space(): mutual exclusion on mmap
This commit is contained in:
@@ -64,6 +64,8 @@ reserve_user_space(struct mcctrl_usrdata *usrdata, unsigned long *startp, unsign
|
||||
unsigned long start = 0L;
|
||||
unsigned long end;
|
||||
|
||||
mutex_lock(&usrdata->reserve_lock);
|
||||
|
||||
#define DESIRED_USER_END 0x800000000000
|
||||
#define GAP_FOR_MCEXEC 0x008000000000UL
|
||||
end = DESIRED_USER_END;
|
||||
@@ -81,6 +83,8 @@ reserve_user_space(struct mcctrl_usrdata *usrdata, unsigned long *startp, unsign
|
||||
up_write(¤t->mm->mmap_sem);
|
||||
#endif
|
||||
|
||||
mutex_unlock(&usrdata->reserve_lock);
|
||||
|
||||
if (IS_ERR_VALUE(start)) {
|
||||
return start;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user