Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751625AbcKCDE5 (ORCPT ); Wed, 2 Nov 2016 23:04:57 -0400 Received: from thejh.net ([37.221.195.125]:35314 "EHLO thejh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750935AbcKCDEz (ORCPT ); Wed, 2 Nov 2016 23:04:55 -0400 From: Jann Horn To: security@kernel.org, Alexander Viro , Paul Moore , Stephen Smalley , Eric Paris , James Morris , "Serge E. Hallyn" , mchong@google.com, Andy Lutomirski , Ingo Molnar , Oleg Nesterov , Nick Kralevich , Janis Danisevskis Cc: linux-security-module@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] fs/exec: don't force writing memory access Date: Thu, 3 Nov 2016 04:04:41 +0100 Message-Id: <1478142286-18427-1-git-send-email-jann@thejh.net> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 804 Lines: 26 This shouldn't change behavior in any way - at this point, there should be no non-writable mappings, only the initial stack mapping -, but this change makes it easier to reason about the correctness of the following commits that place restrictions on forced memory writes. Signed-off-by: Jann Horn Reviewed-by: Janis Danisevskis --- fs/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exec.c b/fs/exec.c index 4e497b9ee71e..dbc2dd2f0829 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -191,7 +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; + unsigned int gup_flags = 0; #ifdef CONFIG_STACK_GROWSUP if (write) { -- 2.1.4