From patchwork Thu Mar 9 08:25:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9612645 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 C8E41602B4 for ; Thu, 9 Mar 2017 08:25:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A292828593 for ; Thu, 9 Mar 2017 08:25:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 976CF285A4; Thu, 9 Mar 2017 08:25:46 +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_SIGNED, 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 B71C328585 for ; Thu, 9 Mar 2017 08:25:45 +0000 (UTC) Received: (qmail 10086 invoked by uid 550); 9 Mar 2017 08:25:39 -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 9880 invoked from network); 9 Mar 2017 08:25:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y1k1//Y5TDua1AYYvdtj9WAVwtOv73TA3hOSPqi/8ZU=; b=Ppu+0cdjWjY8eEgB2lr+Yu8qga/h4fUThNLSMBpbmmt6j2BBithezsTYmBcgaGFfE/ 1CaoM1zFIxLuohE+yxzzYaaW+uxYdeUbdO8Lo3k7xzt0/ATKH6lT8uyrfkrlyQgqVm9z T61dD4fxk58lFTh5bMUl34jlEZRhQEpokFZAY= 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=Y1k1//Y5TDua1AYYvdtj9WAVwtOv73TA3hOSPqi/8ZU=; b=uIpHRJVWRJCNV6ZzPXePvQNd6lV3R9G7TWHKqjQH4amT8sMEhqTQKZiTm8OkmQSfpI hxRmfzGOhvsfwNyXUnDFzJE8L8OHJMxPb1bX8TR0knTx9p+39wgIQ4MJHjq1wY6qvP8H BGEV6e5S5+Zv3JAmgfTGkze38iPCCRR1cs0BaVxJjidpajO1VVHg6sMPEfomKxx1mXo/ jPhwKwsdlPeBCdODoyWofhalrmE5MudlLd2ewJ1I2UbdjKaKDMg08hbfcAWKWKl8tlrI 1sdNjrMEf05UxFrVrx+nqaJgDRf/VaVpXYhUcjxupfd4Co2H7frVOL/SWTfF28sb4lWS MlLw== X-Gm-Message-State: AMke39lnFvJWNOttFtUVYIdeXZHqUpCxDo5M2ctZCN0hAtUrONdjDm3im5JvDw/cKBOdNdnF X-Received: by 10.223.148.230 with SMTP id 93mr10098527wrr.111.1489047924584; Thu, 09 Mar 2017 00:25:24 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, keescook@chromium.org, labbott@fedoraproject.org Cc: kernel-hardening@lists.openwall.com, will.deacon@arm.com, catalin.marinas@arm.com, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, Ard Biesheuvel Date: Thu, 9 Mar 2017 09:25:03 +0100 Message-Id: <1489047912-642-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489047912-642-1-git-send-email-ard.biesheuvel@linaro.org> References: <1489047912-642-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [kernel-hardening] [PATCH v5 01/10] arm: kvm: move kvm_vgic_global_state out of .text section X-Virus-Scanned: ClamAV using ClamSMTP The kvm_vgic_global_state struct contains a static key which is written to by jump_label_init() at boot time. So in preparation of making .text regions truly (well, almost truly) read-only, mark kvm_vgic_global_state __ro_after_init so it moves to the .rodata section instead. Acked-by: Marc Zyngier Reviewed-by: Laura Abbott Reviewed-by: Mark Rutland Tested-by: Mark Rutland Signed-off-by: Ard Biesheuvel --- virt/kvm/arm/vgic/vgic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c index 654dfd40e449..7713d96e85b7 100644 --- a/virt/kvm/arm/vgic/vgic.c +++ b/virt/kvm/arm/vgic/vgic.c @@ -29,7 +29,9 @@ #define DEBUG_SPINLOCK_BUG_ON(p) #endif -struct vgic_global __section(.hyp.text) kvm_vgic_global_state = {.gicv3_cpuif = STATIC_KEY_FALSE_INIT,}; +struct vgic_global kvm_vgic_global_state __ro_after_init = { + .gicv3_cpuif = STATIC_KEY_FALSE_INIT, +}; /* * Locking order is always: