All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com,
	catalin.marinas@arm.com, will.deacon@arm.com,
	labbott@fedoraproject.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	keescook@chromium.org, marc.zyngier@arm.com,
	andre.przywara@arm.com, kernel-hardening@lists.openwall.com,
	kvmarm@lists.cs.columbia.edu
Subject: [PATCH v2 1/5] arm: kvm: move kvm_vgic_global_state out of .text section
Date: Sat, 11 Feb 2017 20:23:02 +0000	[thread overview]
Message-ID: <1486844586-26135-2-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1486844586-26135-1-git-send-email-ard.biesheuvel@linaro.org>

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 <marc.zyngier@arm.com>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 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 6440b56ec90e..2f373455ed4e 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:
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/5] arm: kvm: move kvm_vgic_global_state out of .text section
Date: Sat, 11 Feb 2017 20:23:02 +0000	[thread overview]
Message-ID: <1486844586-26135-2-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1486844586-26135-1-git-send-email-ard.biesheuvel@linaro.org>

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 <marc.zyngier@arm.com>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 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 6440b56ec90e..2f373455ed4e 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:
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com,
	catalin.marinas@arm.com, will.deacon@arm.com,
	labbott@fedoraproject.org
Cc: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com,
	andre.przywara@arm.com, Suzuki.Poulose@arm.com,
	james.morse@arm.com, keescook@chromium.org,
	kernel-hardening@lists.openwall.com,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [kernel-hardening] [PATCH v2 1/5] arm: kvm: move kvm_vgic_global_state out of .text section
Date: Sat, 11 Feb 2017 20:23:02 +0000	[thread overview]
Message-ID: <1486844586-26135-2-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1486844586-26135-1-git-send-email-ard.biesheuvel@linaro.org>

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 <marc.zyngier@arm.com>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 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 6440b56ec90e..2f373455ed4e 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:
-- 
2.7.4

  reply	other threads:[~2017-02-11 20:23 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11 20:23 [PATCH v2 0/5] arm64: mmu: avoid writeable-executable mappings Ard Biesheuvel
2017-02-11 20:23 ` [kernel-hardening] " Ard Biesheuvel
2017-02-11 20:23 ` Ard Biesheuvel
2017-02-11 20:23 ` Ard Biesheuvel [this message]
2017-02-11 20:23   ` [kernel-hardening] [PATCH v2 1/5] arm: kvm: move kvm_vgic_global_state out of .text section Ard Biesheuvel
2017-02-11 20:23   ` Ard Biesheuvel
2017-02-13 17:58   ` Mark Rutland
2017-02-13 17:58     ` [kernel-hardening] " Mark Rutland
2017-02-11 20:23 ` [PATCH v2 2/5] arm64: mmu: move TLB maintenance from callers to create_mapping_late() Ard Biesheuvel
2017-02-11 20:23   ` [kernel-hardening] " Ard Biesheuvel
2017-02-11 20:23   ` Ard Biesheuvel
2017-02-14 15:54   ` Mark Rutland
2017-02-14 15:54     ` [kernel-hardening] " Mark Rutland
2017-02-14 15:54     ` Mark Rutland
2017-02-11 20:23 ` [PATCH v2 3/5] arm64: alternatives: apply boot time fixups via the linear mapping Ard Biesheuvel
2017-02-11 20:23   ` [kernel-hardening] " Ard Biesheuvel
2017-02-11 20:23   ` Ard Biesheuvel
2017-02-14 15:56   ` Mark Rutland
2017-02-14 15:56     ` [kernel-hardening] " Mark Rutland
2017-02-14 15:56     ` Mark Rutland
2017-02-11 20:23 ` [PATCH v2 4/5] arm64: mmu: map .text as read-only from the outset Ard Biesheuvel
2017-02-11 20:23   ` [kernel-hardening] " Ard Biesheuvel
2017-02-11 20:23   ` Ard Biesheuvel
2017-02-14 15:57   ` Mark Rutland
2017-02-14 15:57     ` [kernel-hardening] " Mark Rutland
2017-02-14 15:57     ` Mark Rutland
2017-02-14 16:15     ` Ard Biesheuvel
2017-02-14 16:15       ` [kernel-hardening] " Ard Biesheuvel
2017-02-14 16:15       ` Ard Biesheuvel
2017-02-14 17:40       ` Mark Rutland
2017-02-14 17:40         ` [kernel-hardening] " Mark Rutland
2017-02-14 17:40         ` Mark Rutland
2017-02-14 17:49         ` Ard Biesheuvel
2017-02-14 17:49           ` [kernel-hardening] " Ard Biesheuvel
2017-02-14 17:49           ` Ard Biesheuvel
2017-02-14 17:54           ` Mark Rutland
2017-02-14 17:54             ` [kernel-hardening] " Mark Rutland
2017-02-14 17:54             ` Mark Rutland
2017-02-11 20:23 ` [PATCH v2 5/5] arm64: mmu: apply strict permissions to .init.text and .init.data Ard Biesheuvel
2017-02-11 20:23   ` [kernel-hardening] " Ard Biesheuvel
2017-02-11 20:23   ` Ard Biesheuvel
2017-02-14 15:57   ` Mark Rutland
2017-02-14 15:57     ` [kernel-hardening] " Mark Rutland
2017-02-14 15:57     ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486844586-26135-2-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=andre.przywara@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=labbott@fedoraproject.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.