tmp_suning_uos_patched/arch/sh/kernel
Frederic Weisbecker b2812d031d hw-breakpoints: Change/Enforce some breakpoints policies
The current policies of breakpoints in x86 and SH are the following:

- task bound breakpoints can only break on userspace addresses
- cpu wide breakpoints can only break on kernel addresses

The former rule prevents ptrace breakpoints to be set to trigger on
kernel addresses, which is good. But as a side effect, we can't
breakpoint on kernel addresses for task bound breakpoints.

The latter rule simply makes no sense, there is no reason why we
can't set breakpoints on userspace while performing cpu bound
profiles.

We want the following new policies:

- task bound breakpoint can set userspace address breakpoints, with
no particular privilege required.
- task bound breakpoints can set kernelspace address breakpoints but
must be privileged to do that.
- cpu bound breakpoints can do what they want as they are privileged
already.

To implement these new policies, this patch checks if we are dealing
with a kernel address breakpoint, if so and if the exclude_kernel
parameter is set, we tell the user that the breakpoint is invalid,
which makes a good generic ptrace protection.
If we don't have exclude_kernel, ensure the user has the right
privileges as kernel breakpoints are quite sensitive (risk of
trap recursion attacks and global performance impacts).

[ Paul Mundt: keep addr space check for sh signal delivery and fix
  double function declaration]

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: K. Prasad <prasad@linux.vnet.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-05-01 04:32:10 +02:00
..
cpu include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vsyscall include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
.gitignore
asm-offsets.c
cpufreq.c arch/sh/kernel: Use set_cpus_allowed_ptr 2010-03-29 11:40:37 +09:00
crash_dump.c
debugtraps.S
disassemble.c
dma-nommu.c
dumpstack.c
dwarf.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
entry-common.S
ftrace.c
head_32.S
head_64.S
hw_breakpoint.c hw-breakpoints: Change/Enforce some breakpoints policies 2010-05-01 04:32:10 +02:00
idle.c
init_task.c
io_generic.c
io_trapped.c
io.c
irq_32.c
irq_64.c
irq.c
kgdb.c
kprobes.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
localtimer.c
machine_kexec.c
machvec.c
Makefile
module.c
nmi_debug.c
perf_callchain.c
perf_event.c
process_32.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
process_64.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
process.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ptrace_32.c hw-breakpoints: Tag ptrace breakpoint as exclude_kernel 2010-05-01 04:32:07 +02:00
ptrace_64.c
reboot.c
relocate_kernel.S
return_address.c sh: export return_address() symbol. 2010-04-02 16:02:33 +09:00
setup.c
sh_bios.c
sh_ksyms_32.c
sh_ksyms_64.c
signal_32.c
signal_64.c
smp.c sh: Enable the mmu in start_secondary() 2010-03-29 12:11:51 +09:00
stacktrace.c
swsusp.c
sys_sh32.c
sys_sh64.c
sys_sh.c
syscalls_32.S
syscalls_64.S
time.c
topology.c
traps_32.c
traps_64.c
traps.c
unwinder.c
vmlinux.lds.S