You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
mm: replace get_user_pages_remote() write/force parameters with gup_flags
This removes the 'write' and 'force' from get_user_pages_remote() and replaces them with 'gup_flags' to make the use of FOLL_FORCE explicit in callers as use of this flag can result in surprising behaviour (and hence bugs) within the mm subsystem. Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Acked-by: Michal Hocko <mhocko@suse.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
768ae309a9
commit
9beae1ea89
@@ -191,6 +191,7 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
|
||||
{
|
||||
struct page *page;
|
||||
int ret;
|
||||
unsigned int gup_flags = FOLL_FORCE;
|
||||
|
||||
#ifdef CONFIG_STACK_GROWSUP
|
||||
if (write) {
|
||||
@@ -199,12 +200,16 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (write)
|
||||
gup_flags |= FOLL_WRITE;
|
||||
|
||||
/*
|
||||
* We are doing an exec(). 'current' is the process
|
||||
* doing the exec and bprm->mm is the new process's mm.
|
||||
*/
|
||||
ret = get_user_pages_remote(current, bprm->mm, pos, 1, write,
|
||||
1, &page, NULL);
|
||||
ret = get_user_pages_remote(current, bprm->mm, pos, 1, gup_flags,
|
||||
&page, NULL);
|
||||
if (ret <= 0)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user