From patchwork Thu Mar 9 20:51:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9614157 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 8947860417 for ; Thu, 9 Mar 2017 20:53:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E44228334 for ; Thu, 9 Mar 2017 20:53:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72E352866A; Thu, 9 Mar 2017 20:53:00 +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 96EEF28334 for ; Thu, 9 Mar 2017 20:52:59 +0000 (UTC) Received: (qmail 26106 invoked by uid 550); 9 Mar 2017 20:52:57 -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 24383 invoked from network); 9 Mar 2017 20:52:29 -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=Chp3xAMVeXh3VNPP3ks/xNdB6kx2hKas0RfoD0ZyMKH33BOtXCOrdWyIHj44kvbV2U OI4KXcE0+LPjnnKzpwoW13+rUCekDQrFyePVs3XwvrSVPikYJlZ0/gyy8Ghi96NSpe1M 79IBgi81JUslx9txRUSaw9GV9vfvDw1XL9AT4= 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=HmBNcZEEItlROQWym+TtBI03SK2vhBlkP7FttNBzRrBroPTDrhuk7xFhGUY6YyRGDw f9BaPc9G0nQ/BrBc7lkuruEQq9uu9VxQFbw7zAs1lTfXyWU5NG4Ho/GEYeusOczs162o KODSOLWXsWUCfaYDrto9kbJ+wNsrajav8fGWMpUqVZA3T987ehKmhvzm3qV1AXYPBYMR fQUf1I7SnSsAOgvwrCs+nZdcPXiQeZ5tmpeN8JOQMh+MQF5t6Di7NDiqGa1DUXyjPlCr h7JuKBII089CNFtEMpKCXaSZ8VbiqT1TnYuzbLRdK1LDvh+BCHdayP+7jGqmtcm0OO0N usDw== X-Gm-Message-State: AMke39ljsi8LYTw6aGlowQBCc1xcAIq1M/0+pecLFUmhjePVCbkLUm7lT+qKLbBpmpW2+E4e X-Received: by 10.28.97.2 with SMTP id v2mr31048173wmb.3.1489092738358; Thu, 09 Mar 2017 12:52:18 -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, Ard Biesheuvel Date: Thu, 9 Mar 2017 21:51:59 +0100 Message-Id: <1489092729-16871-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489092729-16871-1-git-send-email-ard.biesheuvel@linaro.org> References: <1489092729-16871-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [kernel-hardening] [PATCH v6 01/11] 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: