From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1949804AbdDYQxr (ORCPT ); Tue, 25 Apr 2017 12:53:47 -0400 Received: from foss.arm.com ([217.140.101.70]:44668 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1432321AbdDYQxW (ORCPT ); Tue, 25 Apr 2017 12:53:22 -0400 Date: Tue, 25 Apr 2017 17:53:21 +0100 From: Will Deacon To: "dongbo (E)" Cc: catalin.marinas@arm.com, arm-mail-list , "linux-kernel@vger.kernel.org" , Linuxarm Subject: Re: [PATCH] arm64: Preventing READ_IMPLIES_EXEC propagation Message-ID: <20170425165320.GT24484@arm.com> References: <1493102296-229934-1-git-send-email-zhangshaokun@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 25, 2017 at 02:11:29PM +0800, dongbo (E) wrote: > From: Dong Bo > > Once the READ_IMPLIES_EXEC flag is set on arm64, the flag is > propagated to its child processes, even the ELF files are > marked as not requiring executable stack. > > Signed-off-by: Dong Bo > --- > arch/arm64/include/asm/elf.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h > index 5d17004..5941e7f 100644 > --- a/arch/arm64/include/asm/elf.h > +++ b/arch/arm64/include/asm/elf.h > @@ -142,6 +142,7 @@ > ({ \ > clear_bit(TIF_32BIT, ¤t->mm->context.flags); \ > clear_thread_flag(TIF_32BIT); \ > + current->personality &= ~READ_IMPLIES_EXEC; \ > }) > /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ This looks good to me: Acked-by: Will Deacon We might also want a comment in the compat code to say that we inherit the flag to follow the arch/arm/ behaviour. Anyway, I'd like to see this sit in -next for a bit, so would rather hold this off until 4.12. Will