Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S980554AbdDYGLu (ORCPT ); Tue, 25 Apr 2017 02:11:50 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5794 "EHLO dggrg01-dlp.huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S980496AbdDYGLq (ORCPT ); Tue, 25 Apr 2017 02:11:46 -0400 Subject: [PATCH] arm64: Preventing READ_IMPLIES_EXEC propagation References: <1493102296-229934-1-git-send-email-zhangshaokun@hisilicon.com> To: , Will Deacon CC: arm-mail-list , "linux-kernel@vger.kernel.org" , Linuxarm From: "dongbo (E)" X-Forwarded-Message-Id: <1493102296-229934-1-git-send-email-zhangshaokun@hisilicon.com> Message-ID: Date: Tue, 25 Apr 2017 14:11:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1493102296-229934-1-git-send-email-zhangshaokun@hisilicon.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.63.194.120] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.58FEE89A.00FC,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 41b8b6afec930471a6dc4718efb5d186 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 763 Lines: 26 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 */ -- 1.9.1 .