From: Kees Cook Date: Fri, 18 Nov 2022 00:31:55 +0000 (-0800) Subject: exec: Remove FOLL_FORCE for stack setup X-Git-Tag: v6.6.17~6048^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd57e443831d8eeb083c7165bce195d886e216d4;p=platform%2Fkernel%2Flinux-rpi.git 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 Cc: David Hildenbrand Cc: Linus Torvalds Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Link: https://lore.kernel.org/lkml/202211171439.CDE720EAD@keescook/ Signed-off-by: Kees Cook --- diff --git a/fs/exec.c b/fs/exec.c index 9585bc1..870a707b 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -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) {