Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932661AbdDRUCQ (ORCPT ); Tue, 18 Apr 2017 16:02:16 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37037 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932475AbdDRUCO (ORCPT ); Tue, 18 Apr 2017 16:02:14 -0400 MIME-Version: 1.0 In-Reply-To: <20170418170118.GH27592@e104818-lin.cambridge.arm.com> References: <1492088223-98232-1-git-send-email-zhangshaokun@hisilicon.com> <2414e3b3-03f6-bd6c-5aa4-ad58c66b5aa5@huawei.com> <20170418170118.GH27592@e104818-lin.cambridge.arm.com> From: Peter Maydell Date: Tue, 18 Apr 2017 21:01:52 +0100 Message-ID: Subject: Re: [PATCH] fs: Preventing READ_IMPLIES_EXEC Propagation To: Catalin Marinas Cc: "dongbo (E)" , Mark Rutland , Peter Maydell , Will Deacon , Linuxarm , "linux-kernel@vger.kernel.org" , Al Viro , linux-fsdevel@vger.kernel.org, arm-mail-list Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1132 Lines: 25 On 18 April 2017 at 18:01, Catalin Marinas wrote: > On Thu, Apr 13, 2017 at 08:33:52PM +0800, dongbo (E) wrote: >> From: Dong Bo >> >> In load_elf_binary(), once the READ_IMPLIES_EXEC flag is set, >> the flag is propagated to its child processes, even the elf >> files are marked as not requiring executable stack. It may >> cause superfluous operations on some arch, e.g. >> __sync_icache_dcache on aarch64 due to a PROT_READ mmap is >> also marked as PROT_EXEC. > That's affecting most architectures with a risk of ABI breakage. We > could do it on arm64 only, though I'm not yet clear on the ABI > implications (at a first look, there shouldn't be any). Is there a reason why it isn't just straightforwardly a bug (which we could fix) to make READ_IMPLIES_EXEC propagate to child processes? AFAICT this should be per-process: just because init happens not to have been (re)compiled to permit non-executable stacks doesn't mean every process on the system needs to have an executable stack. Behaviour shouldn't be variable across architectures either, I would hope. thanks -- PMM