Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1932897imm; Sun, 27 May 2018 20:58:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqxPyOzhns/j3/GQFu/SnQbh10x8JcAK6YpkPH6YLPk7klTD/VAW/Cdh5NKiA8RxgLXSNb+ X-Received: by 2002:a62:6883:: with SMTP id d125-v6mr11935822pfc.26.1527479895079; Sun, 27 May 2018 20:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527479895; cv=none; d=google.com; s=arc-20160816; b=H+I5uI/Ue0NylzTR8gCT4aro8obbt0mR4fSgy6GMX17D9YXeXBMXm0erVQ7T+W22e/ L23FHf3/M5xLeg3Tczth5PGbsC4q6mziSSKa9ggu9BPoRe7/XOkB5aMhdYDbpGqOg2z2 n+FUfcNvfM43X+ItdbFTFYxDHI2pe8qRjjV6pT493u5CZwAN89ytMc74cLIO9SieyQT9 +0E2gXGrYZYGy+0WP20NrbPOBYdAq2upuqXilWDLtqtnMGT9CGTJe1pvuo7SfT5xCArz PCFbXROKfXr16jRfIzAh+PRLNUnig37pGy4ORmvMu5nc0NJuhwwD/cJEQUw1Tw6IDroM mEGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=gtcAMK2Bo7Kknisuzz7pLTwJDrozyhq3GJRFgJP1NQA=; b=UwMisws0EcLsMDrBAxSZA32UC6eNHip+WKQWS+p1tRY773RnVCWMFnRQgWemFk/DxO zvKbwTD8X4GgIsbOcGBE2JG2mBUMXGIIi+JL8Xdz+gs2r/6372M7YkNbOiwQbiV10TZ4 cXV+H9PYVGu2NxdzUCHaV4TW1uq7mVOmX7NwtrOd8VV8WieqOgC9hY7n23kaJGQraNnh IUWQSUWQevW0d1Ke41+PLDvDVPggHr8jMomLHXtlKCK8iYgspvBbKNzHba4A65s7dDVo SjIrOuDphqh6TrVyZeORpfgNoxQnaoMZLU3sJV+tDndlZtjy+V/Eo/TT6GlUo4PEhqfQ tOfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e191-v6si23224185pgc.233.2018.05.27.20.58.00; Sun, 27 May 2018 20:58:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753175AbeE1D5a (ORCPT + 99 others); Sun, 27 May 2018 23:57:30 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8191 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753120AbeE1D51 (ORCPT ); Sun, 27 May 2018 23:57:27 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D7044A3E51A77; Mon, 28 May 2018 11:57:10 +0800 (CST) Received: from linux-work.huawei.com (10.67.189.174) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.382.0; Mon, 28 May 2018 11:57:02 +0800 From: nixiaoming To: , , , , , , , , , CC: , , Subject: [PATCH 2/3] x86:add missing CONFIG_STRICT_KERNEL_RWX for mark_rodata_ro Date: Mon, 28 May 2018 11:33:54 +0800 Message-ID: <20180528033354.54772-1-nixiaoming@huawei.com> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.189.174] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: nixiaoming --- arch/x86/mm/init_32.c | 2 ++ arch/x86/mm/init_64.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index c893c6a..121c567 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -920,6 +920,7 @@ static void mark_nxdata_nx(void) set_pages_nx(virt_to_page(start), size >> PAGE_SHIFT); } +#ifdef CONFIG_STRICT_KERNEL_RWX void mark_rodata_ro(void) { unsigned long start = PFN_ALIGN(_text); @@ -957,3 +958,4 @@ void mark_rodata_ro(void) if (__supported_pte_mask & _PAGE_NX) debug_checkwx(); } +#endif /*end of CONFIG_STRICT_KERNEL_RWX*/ diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 0a40060..1b7a1a7 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1245,6 +1245,7 @@ void set_kernel_text_ro(void) set_memory_ro(start, (end - start) >> PAGE_SHIFT); } +#ifdef CONFIG_STRICT_KERNEL_RWX void mark_rodata_ro(void) { unsigned long start = PFN_ALIGN(_text); @@ -1298,6 +1299,7 @@ void mark_rodata_ro(void) */ pti_clone_kernel_text(); } +#endif int kern_addr_valid(unsigned long addr) { -- 2.10.1