linux/arch/s390/kernel
Gerald Schaefer c1821c2e97 [S390] noexec protection
This provides a noexec protection on s390 hardware. Our hardware does
not have any bits left in the pte for a hw noexec bit, so this is a
different approach using shadow page tables and a special addressing
mode that allows separate address spaces for code and data.

As a special feature of our "secondary-space" addressing mode, separate
page tables can be specified for the translation of data addresses
(storage operands) and instruction addresses. The shadow page table is
used for the instruction addresses and the standard page table for the
data addresses.
The shadow page table is linked to the standard page table by a pointer
in page->lru.next of the struct page corresponding to the page that
contains the standard page table (since page->private is not really
private with the pte_lock and the page table pages are not in the LRU
list).
Depending on the software bits of a pte, it is either inserted into
both page tables or just into the standard (data) page table. Pages of
a vma that does not have the VM_EXEC bit set get mapped only in the
data address space. Any try to execute code on such a page will cause a
page translation exception. The standard reaction to this is a SIGSEGV
with two exceptions: the two system call opcodes 0x0a77 (sys_sigreturn)
and 0x0aad (sys_rt_sigreturn) are allowed. They are stored by the
kernel to the signal stack frame. Unfortunately, the signal return
mechanism cannot be modified to use an SA_RESTORER because the
exception unwinding code depends on the system call opcode stored
behind the signal stack frame.

This feature requires that user space is executed in secondary-space
mode and the kernel in home-space mode, which means that the addressing
modes need to be switched and that the noexec protection only works
for user space.
After switching the addressing modes, we cannot use the mvcp/mvcs
instructions anymore to copy between kernel and user space. A new
mvcos instruction has been added to the z9 EC/BC hardware which allows
to copy between arbitrary address spaces, but on older hardware the
page tables need to be walked manually.

Signed-off-by: Gerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-02-05 21:18:17 +01:00
..
asm-offsets.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
audit.c [PATCH] audit: AUDIT_PERM support 2006-09-11 13:32:30 -04:00
binfmt_elf32.c [PATCH] elf: Always define elf_addr_t in linux/elf.h 2006-12-07 08:39:38 -08:00
bitmap.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
compat_audit.c [PATCH] audit: AUDIT_PERM support 2006-09-11 13:32:30 -04:00
compat_exec_domain.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
compat_linux.c [S390] noexec protection 2007-02-05 21:18:17 +01:00
compat_linux.h [S390] noexec protection 2007-02-05 21:18:17 +01:00
compat_ptrace.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
compat_signal.c [S390] noexec protection 2007-02-05 21:18:17 +01:00
compat_wrapper.S [S390] sys_getcpu compat wrapper. 2006-10-27 12:39:10 +02:00
cpcmd.c [S390] cpcmd with vmalloc addresses. 2007-02-05 21:16:54 +01:00
crash.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
debug.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
ebcdic.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
entry64.S [S390] Whitespace cleanup. 2006-09-28 16:56:37 +02:00
entry.S [S390] Whitespace cleanup. 2006-09-28 16:56:37 +02:00
head31.S [S390] memory detection misses 128k. 2007-01-09 10:18:36 +01:00
head64.S [S390] Fix FCP dump feature detection. 2007-02-05 21:17:07 +01:00
head.S [S390] remove salipl memory detection. 2006-12-04 15:39:47 +01:00
init_task.c [PATCH] nsproxy: move init_nsproxy into kernel/nsproxy.c 2006-10-02 07:57:20 -07:00
ipl.c [S390] noexec protection 2007-02-05 21:18:17 +01:00
irq.c [S390] Move init_irq_proc to the other irq related functions. 2007-02-05 21:16:44 +01:00
kprobes.c [S390] kretprobe_trampoline_holder() in wrong section. 2007-02-05 21:17:32 +01:00
machine_kexec.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
Makefile [S390] Move init_irq_proc to the other irq related functions. 2007-02-05 21:16:44 +01:00
module.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
process.c [S390] noexec protection 2007-02-05 21:18:17 +01:00
ptrace.c [S390] noexec protection 2007-02-05 21:18:17 +01:00
reipl64.S [S390] Save prefix register for dump on panic 2006-12-15 17:18:27 +01:00
reipl.S [S390] Save prefix register for dump on panic 2006-12-15 17:18:27 +01:00
relocate_kernel64.S [S390] Reset infrastructure for re-IPL. 2006-12-04 15:40:26 +01:00
relocate_kernel.S [S390] Reset infrastructure for re-IPL. 2006-12-04 15:40:26 +01:00
reset.S [S390] Fix reboot hang on LPARs 2006-12-15 17:18:22 +01:00
s390_ext.c [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
s390_ksyms.c [PATCH] remove bogus arch-specific syscall exports 2006-10-11 11:17:07 -07:00
semaphore.c [S390] Inline assembly cleanup. 2006-09-28 16:56:43 +02:00
setup.c [S390] noexec protection 2007-02-05 21:18:17 +01:00
signal.c [S390] noexec protection 2007-02-05 21:18:17 +01:00
smp.c [S390] noexec protection 2007-02-05 21:18:17 +01:00
stacktrace.c [S390] stacktrace bug. 2006-10-11 15:31:52 +02:00
sys_s390.c [PATCH] provide kernel_execve on all architectures 2006-10-02 07:57:23 -07:00
syscalls.S [S390] Wire up epoll_pwait syscall. 2006-10-18 18:30:45 +02:00
time.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
traps.c [S390] Fix kprobes breakpoint handling. 2007-02-05 21:17:29 +01:00
vmlinux.lds.S [PATCH] vmlinux.lds: consolidate initcall sections 2006-10-27 15:34:51 -07:00
vtime.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00