From patchwork Sun Feb 19 10:04:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoeun Ryu X-Patchwork-Id: 9581529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9D0BB604A0 for ; Sun, 19 Feb 2017 10:05:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FAD62872C for ; Sun, 19 Feb 2017 10:05:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8468428734; Sun, 19 Feb 2017 10:05:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id C456B2872C for ; Sun, 19 Feb 2017 10:05:51 +0000 (UTC) Received: (qmail 22173 invoked by uid 550); 19 Feb 2017 10:05:50 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 22141 invoked from network); 19 Feb 2017 10:05:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IT7lqg233C3/SUXL2Ui9LNhR57CpJrAYGm6X5MF/itA=; b=FiE3AfQFel6rRKqGqOlxTwrESB0WaeQDQG1PT31c1k0zoAIqKJFG4Wjp7QxCgAtonh 9s0XgaCrugAKHyCao7AbkC1qbd/pTWoXQidf8aCv+IMfxRI0A8e38HfgLpGfZDQ2aYRu IbOVlUHkcJQApNmq8SeDh8Fb8vjCUn2blrsErJPcG6GUEWefPdUfHnhPfViAJOSQmCey PNikdIRgQWRTLcVTYZVoCHlntfQF0hTFLjf9MBxM4Luxo6BUDClNtWP2hphDC+3uDtuf 71+G+kCFQ9FGETnfo8+OCcnn6WG8vD6J5sB/Ijfy7D7guahuYl1846K0UGSqahZkkyVA irUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IT7lqg233C3/SUXL2Ui9LNhR57CpJrAYGm6X5MF/itA=; b=CGPlF8hySW+felZ0XvZ/bd3M2le2zhhgyDUYyNg9xpGy1mRqFeFa3Xe8qvkGyRsyVH 4y3FuOqbfn8RYpzvRqbksARxl4BvEZ9cVX070Bs8cn24+tfGFzQauFkfOIXMf7L2liHb Er1yZ2sLK7IquRrqR7SOHEMnVIUBeONWxGQD+NWPyOcpcKrb22qjs1+0ceVVjxHA82n+ 5ynrYeIy+Jc/shHosrkmze2dKGC5Sjwvv7dGKR3elm+7lejaJtoouWwUhFfqsVz7U6mW D3mM1ZN9tqvQ57t+ROPdgxtSkdI7TevQkjVPIKJAe6XSLXVPi7V1nDeC/iOuNbaylPxG XNHg== X-Gm-Message-State: AMke39nJsgXcxV12ZGwe3QlKevrwxlK5cI+I5zRQ2dYOHwtayiBO8JRC5/+gelJUzFsrzw== X-Received: by 10.99.36.7 with SMTP id k7mr20689619pgk.201.1487498736221; Sun, 19 Feb 2017 02:05:36 -0800 (PST) From: Hoeun Ryu To: kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Cc: Hoeun Ryu , Thomas Gleixner , Sebastian Andrzej Siewior , Ingo Molnar , Anna-Maria Gleixner , Peter Zijlstra , Boris Ostrovsky Date: Sun, 19 Feb 2017 19:04:08 +0900 Message-Id: <1487498660-16600-5-git-send-email-hoeun.ryu@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487498660-16600-1-git-send-email-hoeun.ryu@gmail.com> References: <1487498660-16600-1-git-send-email-hoeun.ryu@gmail.com> Subject: [kernel-hardening] [RFC 5/7] cpu: mark ro_mostly_after_init for cpuhp_ap/bp_states X-Virus-Scanned: ClamAV using ClamSMTP It would be good that `__ro_mostly_after_init` is marked to cpuhp state objects. They can not be simply marked as `__ro_after_init` because they should be writable during module_init/exit. Now that they can be read-only except during module_init/exit Signed-off-by: Hoeun Ryu --- kernel/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 0a5f630..12ad4c2 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1126,7 +1126,7 @@ core_initcall(cpu_hotplug_pm_sync_init); #endif /* CONFIG_SMP */ /* Boot processor state steps */ -static struct cpuhp_step cpuhp_bp_states[] = { +static struct cpuhp_step cpuhp_bp_states[] __ro_mostly_after_init = { [CPUHP_OFFLINE] = { .name = "offline", .startup.single = NULL, @@ -1212,7 +1212,7 @@ static struct cpuhp_step cpuhp_bp_states[] = { }; /* Application processor state steps */ -static struct cpuhp_step cpuhp_ap_states[] = { +static struct cpuhp_step cpuhp_ap_states[] __ro_mostly_after_init = { #ifdef CONFIG_SMP /* Final state before CPU kills itself */ [CPUHP_AP_IDLE_DEAD] = {