exec: Remove FOLL_FORCE for stack setup
Subsystems (3)
PATCH 1/1 exec: Remove FOLL_FORCE for stack setup
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]>
Signed-off-by Kees Cook <[email protected]>
--- fs/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/exec.c +1 -1
@@ -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) {
Signature · 1 line
2.34.1
Quoted 5 lines · Kees Cook
It does not appear that
FOLL_FORCEshould be needed for setting up the stack pages. They are allocated using the nascentbrpm->vma, which was newly created withVM_STACK_FLAGS, which an arch can override, but they all appear to includeVM_WRITE|VM_MAYWRITE. RemoveFOLL_FORCE.
Quoted 8 lines
Cc Eric Biederman <[email protected]>Cc David Hildenbrand <[email protected]>Cc Linus Torvalds <[email protected]>Cc Alexander Viro <[email protected]>Signed-off-by Kees Cook <[email protected]>
Thanks for looking into this!
Reviewed-by David Hildenbrand <[email protected]>
Signature · 3 lines
Thanks, David / dhildenb