linux-kernel-test/arch/x86/include/asm
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
..
uv Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-02-28 11:00:55 -08:00
visws x86: Move pci init function to x86_init 2010-02-19 16:12:29 -08:00
xen
a.out-core.h
a.out.h
acpi.h ACPI: processor: finish unifying arch_acpi_processor_init_pdc() 2009-12-22 03:24:13 -05:00
aes.h
agp.h
alternative-asm.h
alternative.h Merge branch 'perf-probes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-03-05 10:50:22 -08:00
amd_iommu_proto.h x86/amd-iommu: Fix IOMMU-API initialization for iommu=pt 2010-01-22 17:44:35 +01:00
amd_iommu_types.h x86/amd-iommu: warn when issuing command to uninitialized cmd buffer 2010-04-07 11:51:15 +02:00
amd_iommu.h
apb_timer.h x86, apbt: Moorestown APB system timer driver 2010-02-24 11:01:21 -08:00
apic.h x86, apic: Allow to use certain functions without APIC built-in support 2010-03-18 17:03:21 +01:00
apicdef.h
apm.h
asm-offsets.h
asm.h
atomic64_32.h x86: Split atomic64_t functions into seperate headers 2010-01-07 11:47:31 -08:00
atomic64_64.h x86: Split atomic64_t functions into seperate headers 2010-01-07 11:47:31 -08:00
atomic.h x86: Mark atomic irq ops raw for 32bit legacy 2010-02-16 17:19:11 +01:00
auxvec.h
bios_ebda.h
bitops.h
bitsperlong.h
boot.h
bootparam.h
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
calgary.h
calling.h
checksum_32.h
checksum_64.h
checksum.h
cmpxchg_32.h
cmpxchg_64.h
cmpxchg.h
compat.h improve sys_newuname() for compat architectures 2010-03-12 15:52:32 -08:00
cpu.h
cpufeature.h x86, cpu: Print AMD virtualization features in /proc/cpuinfo 2010-02-13 15:04:40 -08:00
cpumask.h
cputime.h
current.h
debugreg.h x86/debug: Clear reserved bits of DR6 in do_debug() 2010-01-29 02:26:10 +01:00
delay.h
desc_defs.h
desc.h
device.h
div64.h
dma-mapping.h dma-mapping: fix off-by-one error in dma_capable() 2009-12-16 07:20:12 -08:00
dma.h
dmi.h
dwarf2.h
e820.h core: Move early_res from arch/x86 to kernel/ 2010-02-16 21:43:39 -08:00
edac.h
efi.h
elf.h x86: ELF_PLAT_INIT() shouldn't worry about TIF_IA32 2010-02-16 08:51:49 -08:00
emergency-restart.h
entry_arch.h
errno.h
fb.h x86-64: Allow fbdev primary video code 2010-02-16 21:22:26 -08:00
fcntl.h
fixmap.h x86: Fix placement of FIX_OHCI1394_BASE 2010-03-16 11:16:27 +01:00
floppy.h
frame.h
ftrace.h
futex.h
gart.h
genapic.h
geode.h cs5535: drop the Geode-specific MFGPT/GPIO code 2009-12-15 08:53:28 -08:00
gpio.h
hardirq.h
highmem.h x86, paravirt: Remove kmap_atomic_pte paravirt op. 2010-02-27 14:41:35 -08:00
hpet.h x86: Disable HPET MSI on ATI SB700/SB800 2010-01-23 06:21:58 +01:00
hugetlb.h
hw_breakpoint.h hw-breakpoints: Change/Enforce some breakpoints policies 2010-05-01 04:32:10 +02:00
hw_irq.h x86: Handle legacy PIC interrupts on all the cpu's 2010-03-16 06:36:35 +01:00
hypertransport.h
hyperv.h KVM: Add HYPER-V header file 2010-03-01 12:35:57 -03:00
hypervisor.h
i387.h x86, ptrace: regset extensions to support xstate 2010-02-11 15:08:17 -08:00
i8253.h
i8259.h Merge remote branch 'origin/x86/apic' into x86/mrst 2010-02-22 16:25:18 -08:00
ia32_unistd.h
ia32.h
idle.h
inat_types.h
inat.h
init.h
insn.h x86: Move MAX_INSN_SIZE into asm/insn.h 2010-03-10 13:23:34 +01:00
inst.h
io_apic.h x86, ioapic: Add dummy ioapic functions 2010-02-23 23:14:07 -08:00
io.h x86: Merge io.h 2010-02-05 13:57:40 -08:00
ioctl.h
ioctls.h
iomap.h
iommu.h
ipcbuf.h
ipi.h
irq_regs.h
irq_remapping.h
irq_vectors.h x86, irq: Use 0x20 for the IRQ_MOVE_CLEANUP_VECTOR instead of 0x1f 2010-01-18 10:59:59 -08:00
irq.h x86, legacy_irq: Remove left over nr_legacy_irqs 2010-02-24 11:01:34 -08:00
irqflags.h
ist.h
k8.h
Kbuild KVM: export <asm/hyperv.h> 2010-03-01 12:36:01 -03:00
kdebug.h
kexec.h
kgdb.h
kmap_types.h
kmemcheck.h
kprobes.h x86: Move MAX_INSN_SIZE into asm/insn.h 2010-03-10 13:23:34 +01:00
kvm_emulate.h KVM: x86 emulator: fix memory access during x86 emulation 2010-03-01 12:36:11 -03:00
kvm_host.h KVM: Fix segment descriptor loading 2010-03-01 12:36:14 -03:00
kvm_para.h KVM: Implement bare minimum of HYPER-V MSRs 2010-03-01 12:35:57 -03:00
kvm.h KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates 2009-12-27 13:36:33 -02:00
ldt.h
lguest_hcall.h lguest: stop using KVM hypercall mechanism 2010-04-14 21:43:56 +09:30
lguest.h
linkage.h
local.h local_t: Remove cpu_local_xx macros 2010-01-05 15:34:49 +09:00
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h
mca_dma.h
mca.h
mce.h x86: mce.h: Fix warning in header checks 2010-01-13 10:41:22 +01:00
microcode.h Revert "x86: ucode-amd: Load ucode-patches once ..." 2010-01-23 06:21:59 +01:00
mman.h
mmconfig.h
mmu_context.h
mmu.h
mmx.h
mmzone_32.h
mmzone_64.h x86, numa: Add fixed node size option for numa emulation 2010-02-15 14:34:10 -08:00
mmzone.h
module.h
mpspec_def.h
mpspec.h
mrst.h x86, mrst: Add vrtc platform data setup code 2010-02-23 23:15:19 -08:00
msgbuf.h
msidef.h
msr-index.h Merge branch 'perf/urgent' into perf/core 2010-04-02 19:38:10 +02:00
msr.h x86, msr: msrs_alloc/free for CONFIG_SMP=n 2009-12-16 15:36:32 -08:00
mtrr.h
mutex_32.h
mutex_64.h
mutex.h
nmi.h x86, perfctr: Remove unused func avail_to_resrv_perfctr_nmi() 2009-12-28 09:36:46 +01:00
nops.h
numa_32.h
numa_64.h x86, numa: Add fixed node size option for numa emulation 2010-02-15 14:34:10 -08:00
numa.h
numaq.h Merge branch 'x86-mrst-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-03-07 15:59:39 -08:00
olpc.h x86, olpc: Use pci subarch init for OLPC 2010-02-25 19:26:23 -08:00
page_32_types.h
page_32.h
page_64_types.h
page_64.h
page_types.h x86: Use the generic page_is_ram() 2010-02-01 16:58:17 -08:00
page.h
param.h
paravirt_types.h x86, paravirt: Remove kmap_atomic_pte paravirt op. 2010-02-27 14:41:35 -08:00
paravirt.h x86, paravirt: Remove kmap_atomic_pte paravirt op. 2010-02-27 14:41:35 -08:00
parport.h
pat.h
pci_64.h x86: Only call dma32_reserve_bootmem 64bit !CONFIG_NUMA 2010-02-10 17:47:18 -08:00
pci_x86.h Merge branch 'x86-mrst-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-03-07 15:59:39 -08:00
pci-direct.h
pci-functions.h
pci.h pci-dma: add linux/pci-dma.h to linux/pci.h 2010-03-12 15:52:42 -08:00
percpu.h percpu, x86: Generic inc / dec percpu instructions 2010-01-05 15:34:50 +09:00
perf_event_p4.h x86, perf: Add raw events support for the P4 PMU 2010-03-26 08:45:49 +01:00
perf_event.h perf: Enhance perf to allow for guest statistic collection from host 2010-04-19 12:35:33 +03:00
pgalloc.h x86, mm: Allow highmem user page tables to be disabled at boot time 2010-02-25 10:28:19 +01:00
pgtable_32_types.h
pgtable_32.h x86: don't include slab.h from arch/x86/include/asm/pgtable_32.h 2010-03-30 22:02:21 +09:00
pgtable_64_types.h
pgtable_64.h MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself 2010-02-20 16:41:46 +00:00
pgtable_types.h
pgtable-2level_types.h
pgtable-2level.h
pgtable-3level_types.h
pgtable-3level.h
pgtable.h
poll.h
posix_types_32.h
posix_types_64.h
posix_types.h
prctl.h
processor-cyrix.h
processor-flags.h
processor.h x86, ptrace: Fix block-step 2010-03-26 11:33:57 +01:00
proto.h Move round_up/down to kernel.h 2010-02-12 09:42:39 -08:00
ptrace-abi.h x86, perf, bts, mm: Delete the never used BTS-ptrace code 2010-03-26 11:33:55 +01:00
ptrace.h x86, perf, bts, mm: Delete the never used BTS-ptrace code 2010-03-26 11:33:55 +01:00
pvclock-abi.h
pvclock.h
rdc321x_defs.h
reboot_fixups.h
reboot.h
required-features.h
resource.h
resume-trace.h
rio.h
rtc.h
rwlock.h
rwsem.h x86-64, rwsem: Avoid store forwarding hazard in __downgrade_write 2010-02-13 13:37:56 -08:00
scatterlist.h
seccomp_32.h
seccomp_64.h
seccomp.h
sections.h
segment.h
sembuf.h
serial.h
setup_arch.h
setup.h x86: Move pci init function to x86_init 2010-02-19 16:12:29 -08:00
shmbuf.h
shmparam.h
sigcontext32.h
sigcontext.h
sigframe.h
siginfo.h
signal.h
smp.h x86, lib: Add wbinvd smp helpers 2010-01-22 16:05:42 -08:00
smpboot_hooks.h
socket.h
sockios.h
sparsemem.h
spinlock_types.h
spinlock.h
srat.h
stackprotector.h
stacktrace.h perf: Drop useless check for ignored frame 2010-01-13 10:09:08 +01:00
stat.h
statfs.h
string_32.h
string_64.h
string.h
suspend_32.h
suspend_64.h
suspend.h
svm.h KVM: SVM: Fix SVM_CR0_SELECTIVE_MASK 2010-03-01 12:35:51 -03:00
swab.h
swiotlb.h
sync_bitops.h
sys_ia32.h Add generic sys_olduname() 2010-03-12 15:52:32 -08:00
syscall.h tracing: Unify arch_syscall_addr() implementations 2010-02-17 13:07:21 +01:00
syscalls.h Add generic sys_olduname() 2010-03-12 15:52:32 -08:00
system_64.h
system.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2010-03-03 07:34:18 -08:00
tce.h
termbits.h
termios.h
thread_info.h x86, ptrace: Fix block-step 2010-03-26 11:33:57 +01:00
time.h
timer.h
timex.h
tlb.h
tlbflush.h
topology.h
trampoline.h
traps.h
tsc.h
types.h
uaccess_32.h x86: copy_from_user() should not return -EFAULT 2010-01-05 13:45:06 -08:00
uaccess_64.h Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-02-28 10:35:09 -08:00
uaccess.h
ucontext.h
unaligned.h
unistd_32.h Add generic sys_olduname() 2010-03-12 15:52:32 -08:00
unistd_64.h Add generic sys_olduname() 2010-03-12 15:52:32 -08:00
unistd.h
user32.h
user_32.h
user_64.h
user.h x86, ptrace: regset extensions to support xstate 2010-02-11 15:08:17 -08:00
vdso.h
vga.h
vgtod.h
virtext.h
vm86.h
vmi_time.h
vmi.h
vmware.h
vmx.h KVM: VMX: Rename VMX_EPT_IGMT_BIT to VMX_EPT_IPAT_BIT 2010-03-01 12:36:09 -03:00
vsyscall.h
x86_init.h Merge branch 'x86-mrst-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-03-07 15:59:39 -08:00
xcr.h
xor_32.h
xor_64.h
xor.h
xsave.h x86, ptrace: regset extensions to support xstate 2010-02-11 15:08:17 -08:00