mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 07:20:09 +07:00
33a709b25a
Today, for normal faults and page table walks, we check the VMA and/or PTE to ensure that it is compatible with the action. For instance, if we get a write fault on a non-writeable VMA, we SIGSEGV. We try to do the same thing for protection keys. Basically, we try to make sure that if a user does this: mprotect(ptr, size, PROT_NONE); *ptr = foo; they see the same effects with protection keys when they do this: mprotect(ptr, size, PROT_READ|PROT_WRITE); set_pkey(ptr, size, 4); wrpkru(0xffffff3f); // access disable pkey 4 *ptr = foo; The state to do that checking is in the VMA, but we also sometimes have to do it on the page tables only, like when doing a get_user_pages_fast() where we have no VMA. We add two functions and expose them to generic code: arch_pte_access_permitted(pte_flags, write) arch_vma_access_permitted(vma, write) These are, of course, backed up in x86 arch code with checks against the PTE or VMA's protection key. But, there are also cases where we do not want to respect protection keys. When we ptrace(), for instance, we do not want to apply the tracer's PKRU permissions to the PTEs from the process being traced. Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: Alexey Kardashevskiy <aik@ozlabs.ru> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Andy Lutomirski <luto@kernel.org> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Boaz Harrosh <boaz@plexistor.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Dave Hansen <dave@sr71.net> Cc: David Gibson <david@gibson.dropbear.id.au> Cc: David Hildenbrand <dahi@linux.vnet.ibm.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com> Cc: Dominik Vogt <vogt@linux.vnet.ibm.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Hugh Dickins <hughd@google.com> Cc: Jason Low <jason.low2@hp.com> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Juergen Gross <jgross@suse.com> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Laurent Dufour <ldufour@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Matthew Wilcox <willy@linux.intel.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Hocko <mhocko@suse.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Shachar Raindel <raindel@mellanox.com> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: Toshi Kani <toshi.kani@hpe.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-s390@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/20160212210219.14D5D715@viggo.jf.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org> |
||
---|---|---|
.. | ||
crypto | ||
fpu | ||
numachip | ||
trace | ||
uv | ||
xen | ||
a.out-core.h | ||
acenv.h | ||
acpi.h | ||
agp.h | ||
alternative-asm.h | ||
alternative.h | ||
amd_nb.h | ||
apb_timer.h | ||
apic_flat_64.h | ||
apic.h | ||
apicdef.h | ||
apm.h | ||
arch_hweight.h | ||
archrandom.h | ||
asm-offsets.h | ||
asm.h | ||
atomic64_32.h | ||
atomic64_64.h | ||
atomic.h | ||
barrier.h | ||
bios_ebda.h | ||
bitops.h | ||
boot.h | ||
bootparam_utils.h | ||
bug.h | ||
bugs.h | ||
cache.h | ||
cacheflush.h | ||
calgary.h | ||
ce4100.h | ||
checksum_32.h | ||
checksum_64.h | ||
checksum.h | ||
clocksource.h | ||
cmdline.h | ||
cmpxchg_32.h | ||
cmpxchg_64.h | ||
cmpxchg.h | ||
compat.h | ||
cpu_device_id.h | ||
cpu.h | ||
cpufeature.h | ||
cpufeatures.h | ||
cpumask.h | ||
crash.h | ||
current.h | ||
debugreg.h | ||
delay.h | ||
desc_defs.h | ||
desc.h | ||
device.h | ||
disabled-features.h | ||
div64.h | ||
dma-mapping.h | ||
dma.h | ||
dmi.h | ||
dwarf2.h | ||
e820.h | ||
edac.h | ||
efi.h | ||
elf.h | ||
emergency-restart.h | ||
entry_arch.h | ||
espfix.h | ||
exec.h | ||
fb.h | ||
fixmap.h | ||
floppy.h | ||
frame.h | ||
ftrace.h | ||
futex.h | ||
gart.h | ||
genapic.h | ||
geode.h | ||
gpio.h | ||
hardirq.h | ||
highmem.h | ||
hpet.h | ||
hugetlb.h | ||
hw_breakpoint.h | ||
hw_irq.h | ||
hypertransport.h | ||
hypervisor.h | ||
i8259.h | ||
ia32_unistd.h | ||
ia32.h | ||
idle.h | ||
imr.h | ||
inat_types.h | ||
inat.h | ||
init.h | ||
insn.h | ||
inst.h | ||
intel_mid_vrtc.h | ||
intel_pmc_ipc.h | ||
intel_pt.h | ||
intel_punit_ipc.h | ||
intel_scu_ipc.h | ||
intel_telemetry.h | ||
intel-mid.h | ||
io_apic.h | ||
io.h | ||
iomap.h | ||
iommu_table.h | ||
iommu.h | ||
iosf_mbi.h | ||
ipi.h | ||
irq_regs.h | ||
irq_remapping.h | ||
irq_vectors.h | ||
irq_work.h | ||
irq.h | ||
irqdomain.h | ||
irqflags.h | ||
ist.h | ||
jump_label.h | ||
kasan.h | ||
kbdleds.h | ||
Kbuild | ||
kdebug.h | ||
kexec-bzimage64.h | ||
kexec.h | ||
kgdb.h | ||
kmap_types.h | ||
kmemcheck.h | ||
kprobes.h | ||
kvm_emulate.h | ||
kvm_guest.h | ||
kvm_host.h | ||
kvm_para.h | ||
lguest_hcall.h | ||
lguest.h | ||
linkage.h | ||
livepatch.h | ||
local64.h | ||
local.h | ||
mach_timer.h | ||
mach_traps.h | ||
math_emu.h | ||
mc146818rtc.h | ||
mce.h | ||
microcode_amd.h | ||
microcode_intel.h | ||
microcode.h | ||
misc.h | ||
mmconfig.h | ||
mmu_context.h | ||
mmu.h | ||
mmx.h | ||
mmzone_32.h | ||
mmzone_64.h | ||
mmzone.h | ||
module.h | ||
mpspec_def.h | ||
mpspec.h | ||
mpx.h | ||
mshyperv.h | ||
msi.h | ||
msidef.h | ||
msr-index.h | ||
msr-trace.h | ||
msr.h | ||
mtrr.h | ||
mutex_32.h | ||
mutex_64.h | ||
mutex.h | ||
mwait.h | ||
nmi.h | ||
nops.h | ||
numa_32.h | ||
numa.h | ||
olpc_ofw.h | ||
olpc.h | ||
page_32_types.h | ||
page_32.h | ||
page_64_types.h | ||
page_64.h | ||
page_types.h | ||
page.h | ||
paravirt_types.h | ||
paravirt.h | ||
parport.h | ||
pat.h | ||
pci_64.h | ||
pci_x86.h | ||
pci-direct.h | ||
pci-functions.h | ||
pci.h | ||
percpu.h | ||
perf_event_p4.h | ||
perf_event.h | ||
pgalloc.h | ||
pgtable_32_types.h | ||
pgtable_32.h | ||
pgtable_64_types.h | ||
pgtable_64.h | ||
pgtable_types.h | ||
pgtable-2level_types.h | ||
pgtable-2level.h | ||
pgtable-3level_types.h | ||
pgtable-3level.h | ||
pgtable.h | ||
platform_sst_audio.h | ||
pm-trace.h | ||
pmc_atom.h | ||
pmem.h | ||
posix_types.h | ||
preempt.h | ||
probe_roms.h | ||
processor-cyrix.h | ||
processor-flags.h | ||
processor.h | ||
prom.h | ||
proto.h | ||
ptrace.h | ||
pvclock-abi.h | ||
pvclock.h | ||
qrwlock.h | ||
qspinlock_paravirt.h | ||
qspinlock.h | ||
realmode.h | ||
reboot_fixups.h | ||
reboot.h | ||
required-features.h | ||
rio.h | ||
rmwcc.h | ||
rtc.h | ||
rwsem.h | ||
seccomp.h | ||
sections.h | ||
segment.h | ||
serial.h | ||
setup_arch.h | ||
setup.h | ||
shmparam.h | ||
sigcontext.h | ||
sigframe.h | ||
sighandling.h | ||
signal.h | ||
simd.h | ||
smap.h | ||
smp.h | ||
sparsemem.h | ||
special_insns.h | ||
spinlock_types.h | ||
spinlock.h | ||
sta2x11.h | ||
stackprotector.h | ||
stacktrace.h | ||
string_32.h | ||
string_64.h | ||
string.h | ||
suspend_32.h | ||
suspend_64.h | ||
suspend.h | ||
svm.h | ||
swiotlb.h | ||
switch_to.h | ||
sync_bitops.h | ||
sys_ia32.h | ||
syscall.h | ||
syscalls.h | ||
sysfb.h | ||
tce.h | ||
thread_info.h | ||
time.h | ||
timer.h | ||
timex.h | ||
tlb.h | ||
tlbflush.h | ||
topology.h | ||
trace_clock.h | ||
traps.h | ||
tsc.h | ||
uaccess_32.h | ||
uaccess_64.h | ||
uaccess.h | ||
unaligned.h | ||
unistd.h | ||
uprobes.h | ||
user32.h | ||
user_32.h | ||
user_64.h | ||
user.h | ||
vdso.h | ||
vga.h | ||
vgtod.h | ||
virtext.h | ||
vm86.h | ||
vmx.h | ||
vsyscall.h | ||
vvar.h | ||
word-at-a-time.h | ||
x2apic.h | ||
x86_init.h | ||
xor_32.h | ||
xor_64.h | ||
xor_avx.h | ||
xor.h |