From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
kernel-team@lists.ubuntu.com
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
Linus Torvalds <torvalds@linux-foundation.org>,
Mike Galbraith <efault@gmx.de>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>,
Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 3.16.y-ckt 083/104] x86/mm: Set NX on gap between __ex_table and rodata
Date: Mon, 26 Oct 2015 13:43:05 +0000 [thread overview]
Message-ID: <1445867006-18048-84-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1445867006-18048-1-git-send-email-luis.henriques@canonical.com>
3.16.7-ckt19 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Smalley <sds@tycho.nsa.gov>
commit ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 upstream.
Unused space between the end of __ex_table and the start of
rodata can be left W+x in the kernel page tables. Extend the
setting of the NX bit to cover this gap by starting from
text_end rather than rodata_start.
Before:
---[ High Kernel Mapping ]---
0xffffffff80000000-0xffffffff81000000 16M pmd
0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd
0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte
0xffffffff81754000-0xffffffff81800000 688K RW GLB x pte
0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd
0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte
0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte
0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd
0xffffffff82200000-0xffffffffa0000000 478M pmd
After:
---[ High Kernel Mapping ]---
0xffffffff80000000-0xffffffff81000000 16M pmd
0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd
0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte
0xffffffff81754000-0xffffffff81800000 688K RW GLB NX pte
0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd
0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte
0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte
0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd
0xffffffff82200000-0xffffffffa0000000 478M pmd
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/1443704662-3138-1-git-send-email-sds@tycho.nsa.gov
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/x86/mm/init_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 5146f4652092..12e5ac7885f8 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1131,7 +1131,7 @@ void mark_rodata_ro(void)
* has been zapped already via cleanup_highmem().
*/
all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
- set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
+ set_memory_nx(text_end, (all_end - text_end) >> PAGE_SHIFT);
rodata_test();
next prev parent reply other threads:[~2015-10-26 13:51 UTC|newest]
Thread overview: 115+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 13:41 [3.16.y-ckt stable] Linux 3.16.7-ckt19 stable review Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 001/104] ARM: 8429/1: disable GCC SRA optimization Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 002/104] CIFS: fix type confusion in copy offload ioctl Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 003/104] hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for most chips Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 004/104] x86/apic: Serialize LVTT and TSC_DEADLINE writes Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 005/104] arm64: head.S: initialise mdcr_el2 in el2_setup Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 006/104] kvm: don't try to register to KVM_FAST_MMIO_BUS for non mmio eventfd Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 007/104] kvm: factor out core eventfd assign/deassign logic Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 008/104] kvm: fix double free for fast mmio eventfd Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 009/104] kvm: fix zero length mmio searching Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 010/104] ARM: fix Thumb2 signal handling when ARMv6 is enabled Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 011/104] powerpc/boot: Specify ABI v2 when building an LE boot wrapper Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 012/104] powerpc/mm: Recompute hash value after a failed update Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 013/104] x86/platform: Fix Geode LX timekeeping in the generic x86 build Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 014/104] arm64: compat: fix vfp save/restore across signal handlers in big-endian Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 015/104] arm64: errata: add module build workaround for erratum #843419 Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 016/104] arm64: KVM: Disable virtual timer even if the guest is not using it Luis Henriques
2015-10-26 13:41 ` [PATCH 3.16.y-ckt 017/104] arm: " Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 018/104] hp-wmi: Add missing __init annotations to initialization code Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 019/104] hp-wmi: limit hotkey enable Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 020/104] zram: fix possible use after free in zcomp_create() Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 021/104] perf header: Fixup reading of HEADER_NRCPUS feature Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 022/104] dcache: Handle escaped paths in prepend_path Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 023/104] vfs: Test for and handle paths that are unreachable from their mnt_root Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 024/104] spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 025/104] spi: Fix documentation of spi_alloc_master() Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 026/104] USB: option: add ZTE PIDs Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 027/104] drm/vmwgfx: Fix up user_dmabuf refcounting Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 028/104] ARM: dts: omap3-beagle: make i2c3, ddc and tfp410 gpio work again Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 029/104] Btrfs: fix read corruption of compressed and shared extents Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 030/104] btrfs: skip waiting on ordered range for special files Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 031/104] usb: chipidea: udc: using the correct stall implementation Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 032/104] net: mvneta: fix DMA buffer unmapping in mvneta_rx() Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 033/104] iser-target: remove command with state ISTATE_REMOVE Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 034/104] staging: ion: fix corruption of ion_import_dma_buf Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 035/104] KVM: x86: trap AMD MSRs for the TSeg base and mask Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 036/104] usb: Use the USB_SS_MULT() macro to get the burst multiplier Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 037/104] xhci: give command abortion one more chance before killing xhci Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 038/104] usb: xhci: Clear XHCI_STATE_DYING on start Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 039/104] usb: xhci: Allow usb_add/remove_hcd() to be called repeatedly Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 040/104] xhci: change xhci 1.0 only restrictions to support xhci 1.1 Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 041/104] xhci-mem: Use setup_timer Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 042/104] xhci: init command timeout timer earlier to avoid deleting it uninitialized Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 043/104] spi: xtensa-xtfpga: fix register endianness Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 044/104] disabling oplocks/leases via module parm enable_oplocks broken for SMB3 Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 045/104] cifs: use server timestamp for ntlmv2 authentication Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 046/104] x86/paravirt: Replace the paravirt nop with a bona fide empty function Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 047/104] x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 048/104] ASoC: pxa: pxa2xx-ac97: fix dma requestor lines Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 049/104] ocfs2/dlm: fix deadlock when dispatch assert master Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 050/104] drm/i915/bios: handle MIPI Sequence Block v3+ gracefully Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 051/104] USB: whiteheat: fix potential null-deref at probe Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 052/104] drm/qxl: only report first monitor as connected if we have no state Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 053/104] PCI: Fix devfn for VPD access through function 0 Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 054/104] PCI: Use function 0 VPD for identical functions, regular VPD for others Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 055/104] netfilter: nft_compat: skip family comparison in case of NFPROTO_UNSPEC Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 056/104] ASoC: fix broken pxa SoC support Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 057/104] ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 058/104] vxlan: set needed headroom correctly Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 059/104] Revert "ARM: orion5x: fix legacy orion5x IRQ numbers" Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 060/104] jbd2: avoid infinite loop when destroying aborted journal Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 061/104] asix: Don't reset PHY on if_up for ASIX 88772 Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 062/104] asix: Do full reset during ax88772_bind Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 063/104] fib_rules: Fix dump_rules() not to exit early Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 064/104] net/xen-netfront: only napi_synchronize() if running Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 065/104] cpufreq: intel_pstate: Remove unnecessary type casting in div_s64() call Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 066/104] intel_pstate: Fix overflow in busy_scaled due to long delay Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 067/104] tools lib traceevent: Fix string handling in heterogeneous arch environments Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 068/104] perf tools: Fix copying of /proc/kcore Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 069/104] m68k: Define asmlinkage_protect Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 070/104] UBI: Validate data_size Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 071/104] UBI: return ENOSPC if no enough space available Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 072/104] drm/radeon: Restore LCD backlight level on resume (>= R5xx) Luis Henriques
2015-10-27 2:10 ` Michel Dänzer
2015-10-28 10:45 ` Luis Henriques
2015-11-02 7:52 ` Michel Dänzer
2015-11-11 15:43 ` Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 073/104] MIPS: dma-default: Fix 32-bit fall back to GFP_DMA Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 074/104] MIPS: CPS: Stop dangling delay slot from has_mt Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 075/104] MIPS: CPS: Don't include MT code in non-MT kernels Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 076/104] MIPS: CPS: #ifdef on CONFIG_MIPS_MT_SMP rather than CONFIG_MIPS_MT Luis Henriques
2015-10-26 13:42 ` [PATCH 3.16.y-ckt 077/104] Initialize msg/shm IPC objects before doing ipc_addid() Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 078/104] drm/qxl: recreate the primary surface when the bo is not primary Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 079/104] genirq: Fix race in register_irq_proc() Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 080/104] x86/efi: Fix boot crash by mapping EFI memmap entries bottom-up at runtime, instead of top-down Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 081/104] Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 082/104] mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault Luis Henriques
2015-10-26 13:43 ` Luis Henriques [this message]
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 084/104] clocksource: Fix abs() usage w/ 64bit values Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 085/104] dmaengine: dw: properly read DWC_PARAMS register Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 086/104] mm/slab: fix unexpected index mapping result of kmalloc_size(INDEX_NODE+1) Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 087/104] drm/vmwgfx: Fix kernel NULL pointer dereference on older hardware Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 088/104] fs: if a coredump already exists, unlink and recreate with O_EXCL Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 089/104] sctp: donot reset the overall_error_count in SHUTDOWN_RECEIVE state Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 090/104] ipc/sem.c: fully initialize sem_array before making it visible Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 091/104] drivers: usb :fsl: Implement Workaround for USB Erratum A007792 Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 092/104] drivers: usb: fsl: Workaround for USB erratum-A005275 Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 093/104] l2tp: protect tunnel->del_work by ref_count Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 094/104] af_unix: Convert the unix_sk macro to an inline function for type safety Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 095/104] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 096/104] net/unix: fix logic about sk_peek_offset Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 097/104] skbuff: Fix skb checksum flag on skb pull Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 098/104] skbuff: Fix skb checksum partial check Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 099/104] net: add pfmemalloc check in sk_add_backlog() Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 100/104] ppp: don't override sk->sk_state in pppoe_flush_dev() Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 101/104] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 102/104] ovs: do not allocate memory from offline numa node Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 103/104] netlink: Trim skb to alloc size to avoid MSG_TRUNC Luis Henriques
2015-10-26 13:43 ` [PATCH 3.16.y-ckt 104/104] net: add length argument to skb_copy_and_csum_datagram_iovec Luis Henriques
2015-10-26 19:02 ` [3.16.y-ckt stable] Linux 3.16.7-ckt19 stable review Luis Henriques
2015-10-28 16:51 ` Luis Henriques
2015-10-26 19:05 ` [PATCH 3.16.y-ckt 105/107] KEYS: Fix race between key destruction and finding a keyring by name Luis Henriques
2015-10-26 19:05 ` [PATCH 3.16.y-ckt 106/107] KEYS: Fix crash when attempt to garbage collect an uninstantiated keyring Luis Henriques
2015-10-26 19:05 ` [PATCH 3.16.y-ckt 107/107] KEYS: Don't permit request_key() to construct a new keyring Luis Henriques
2015-10-28 16:52 ` [PATCH 3.16.y-ckt 108/108] Btrfs: update fix for read corruption of compressed and shared extents Luis Henriques
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=1445867006-18048-84-git-send-email-luis.henriques@canonical.com \
--to=luis.henriques@canonical.com \
--cc=efault@gmx.de \
--cc=kernel-team@lists.ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=sds@tycho.nsa.gov \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®