Skip to content

Commit

Permalink
exec: Remove FOLL_FORCE for stack setup
Browse files Browse the repository at this point in the history
It does not appear that FOLL_FORCE should be needed for setting up the
stack pages. They are allocated using the nascent brpm->vma, which was
newly created with VM_STACK_FLAGS, which an arch can override, but they
all appear to include VM_WRITE | VM_MAYWRITE. Remove FOLL_FORCE.

Cc: Eric Biederman <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/lkml/202211171439.CDE720EAD@keescook/
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
kees committed Nov 18, 2022
1 parent dc64cc1 commit cd57e44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,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;
unsigned int gup_flags = 0;

#ifdef CONFIG_STACK_GROWSUP
if (write) {
Expand Down

0 comments on commit cd57e44

Please sign in to comment.