[PATCH] [SRU] [Config] armhf: disable JUMP_LABEL

Paolo Pisati paolo.pisati at canonical.com
Thu Oct 16 07:41:52 UTC 2014


JUMP_LABEL is a branch optimization technic that
makes certain branch conditions cheaper to execute within the kernel,
(e.g. trace points, scheduler functionality, networking code and KVM).

It works by injecting 'nop' at those branch points, and then rewriting
the correct jump instruction when the branch condition becomes true.

Unfortunately, the code rewriting that JUMP_LABEL does interferes with another
security option called DEBUG_SET_MODULE_RONX that marks text and data section
read-only upon modules loading.

While arch like x86 have grown finer control over module's section protection,
armhf has not, and thus the loading of a module that use the JUMP_LABEL optimization
ends up with an oops.

There are some patches that could solve this condition for arm, but those are not
upstream yet and haven't seen broader testing thus i don't feel comfortable in
pulling those in, and i prefer to disable the JUMP_LABEL optimization.

Signed-off-by: Paolo Pisati <paolo.pisati at canonical.com>
---
 debian.master/config/amd64/config.common.amd64     | 1 +
 debian.master/config/arm64/config.common.arm64     | 1 +
 debian.master/config/armhf/config.common.armhf     | 1 +
 debian.master/config/config.common.ubuntu          | 1 -
 debian.master/config/i386/config.common.i386       | 1 +
 debian.master/config/powerpc/config.common.powerpc | 1 +
 debian.master/config/ppc64el/config.common.ppc64el | 1 +
 7 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/debian.master/config/amd64/config.common.amd64 b/debian.master/config/amd64/config.common.amd64
index c078aacb..8f6a6f3 100644
--- a/debian.master/config/amd64/config.common.amd64
+++ b/debian.master/config/amd64/config.common.amd64
@@ -52,6 +52,7 @@ CONFIG_HOTPLUG_PCI_SHPC=m
 CONFIG_HUGETLB_PAGE=y
 CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
 CONFIG_IMA=y
+CONFIG_JUMP_LABEL=y
 CONFIG_KVM=m
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_LUSTRE_FS=m
diff --git a/debian.master/config/arm64/config.common.arm64 b/debian.master/config/arm64/config.common.arm64
index 5446941..39e4504 100644
--- a/debian.master/config/arm64/config.common.arm64
+++ b/debian.master/config/arm64/config.common.arm64
@@ -48,6 +48,7 @@ CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_HZ=100
 CONFIG_IMA=y
+CONFIG_JUMP_LABEL=y
 CONFIG_KVM=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_LUSTRE_FS=m
diff --git a/debian.master/config/armhf/config.common.armhf b/debian.master/config/armhf/config.common.armhf
index 7c85620..4b23ff8 100644
--- a/debian.master/config/armhf/config.common.armhf
+++ b/debian.master/config/armhf/config.common.armhf
@@ -46,6 +46,7 @@ CONFIG_HZ=250
 CONFIG_HZ_250=y
 CONFIG_IMA=y
 # CONFIG_IRQ_FORCED_THREADING_DEFAULT is not set
+# CONFIG_JUMP_LABEL is not set
 CONFIG_KVM=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_LUSTRE_FS=m
diff --git a/debian.master/config/config.common.ubuntu b/debian.master/config/config.common.ubuntu
index 097b047..6ce58cf 100644
--- a/debian.master/config/config.common.ubuntu
+++ b/debian.master/config/config.common.ubuntu
@@ -3472,7 +3472,6 @@ CONFIG_JOYSTICK_XPAD=m
 CONFIG_JOYSTICK_XPAD_FF=y
 CONFIG_JOYSTICK_XPAD_LEDS=y
 CONFIG_JOYSTICK_ZHENHUA=m
-CONFIG_JUMP_LABEL=y
 CONFIG_K3_DMA=m
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
diff --git a/debian.master/config/i386/config.common.i386 b/debian.master/config/i386/config.common.i386
index 051e461..60976f1 100644
--- a/debian.master/config/i386/config.common.i386
+++ b/debian.master/config/i386/config.common.i386
@@ -52,6 +52,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_ILLEGAL_POINTER_VALUE=0
 CONFIG_IMA=y
 CONFIG_ISA=y
+CONFIG_JUMP_LABEL=y
 CONFIG_KVM=m
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_LUSTRE_FS=m
diff --git a/debian.master/config/powerpc/config.common.powerpc b/debian.master/config/powerpc/config.common.powerpc
index 33f2bbf..312ac17 100644
--- a/debian.master/config/powerpc/config.common.powerpc
+++ b/debian.master/config/powerpc/config.common.powerpc
@@ -47,6 +47,7 @@ CONFIG_IBMVETH=m
 # CONFIG_IRQ_ALL_CPUS is not set
 # CONFIG_IRQ_FORCED_THREADING_DEFAULT is not set
 # CONFIG_ISA is not set
+CONFIG_JUMP_LABEL=y
 CONFIG_KVM=y
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_LPARCFG is not set
diff --git a/debian.master/config/ppc64el/config.common.ppc64el b/debian.master/config/ppc64el/config.common.ppc64el
index f70628e..dbe6621 100644
--- a/debian.master/config/ppc64el/config.common.ppc64el
+++ b/debian.master/config/ppc64el/config.common.ppc64el
@@ -66,6 +66,7 @@ CONFIG_IBMVETH=y
 CONFIG_IMA=y
 CONFIG_IRQ_ALL_CPUS=y
 # CONFIG_IRQ_FORCED_THREADING_DEFAULT is not set
+CONFIG_JUMP_LABEL=y
 CONFIG_KERNEL_START=0xc000000000000000
 CONFIG_KVM=y
 CONFIG_LOG_BUF_SHIFT=17
-- 
2.1.0





More information about the kernel-team mailing list