WSL2-Linux-Kernel/arch/x86/include/asm
Paul Moore 8b4b9f27e5 x86: remove the x32 syscall bitmask from syscall_get_nr()
Commit fca460f95e simplified the x32
implementation by creating a syscall bitmask, equal to 0x40000000, that
could be applied to x32 syscalls such that the masked syscall number
would be the same as a x86_64 syscall.  While that patch was a nice
way to simplify the code, it went a bit too far by adding the mask to
syscall_get_nr(); returning the masked syscall numbers can cause
confusion with callers that expect syscall numbers matching the x32
ABI, e.g. unmasked syscall numbers.

This patch fixes this by simply removing the mask from syscall_get_nr()
while preserving the other changes from the original commit.  While
there are several syscall_get_nr() callers in the kernel, most simply
check that the syscall number is greater than zero, in this case this
patch will have no effect.  Of those remaining callers, they appear
to be few, seccomp and ftrace, and from my testing of seccomp without
this patch the original commit definitely breaks things; the seccomp
filter does not correctly filter the syscalls due to the difference in
syscall numbers in the BPF filter and the value from syscall_get_nr().
Applying this patch restores the seccomp BPF filter functionality on
x32.

I've tested this patch with the seccomp BPF filters as well as ftrace
and everything looks reasonable to me; needless to say general usage
seemed fine as well.

Signed-off-by: Paul Moore <pmoore@redhat.com>
Link: http://lkml.kernel.org/r/20130215172143.12549.10292.stgit@localhost
Cc: <stable@vger.kernel.org>
Cc: Will Drewry <wad@chromium.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-04-02 14:38:09 -07:00
..
crypto crypto: camellia-x86_64 - share common functions and move structures and function definitions to header file 2012-11-09 17:32:31 +08:00
numachip x86/PCI: Add NumaChip remote PCI support 2012-12-07 14:24:32 -07:00
uv x86, uv, uv3: Trim MMR register definitions after code changes for SGI UV3 2013-02-11 17:18:25 -08:00
visws
xen xen-pciback: notify hypervisor about devices intended to be assigned to guests 2013-03-22 10:20:55 -04:00
Kbuild UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
a.out-core.h
acpi.h ACPICA: Update compilation environment settings. 2013-01-10 12:36:17 +01:00
agp.h
alternative-asm.h x86, alternative: Add header guards to <asm/alternative-asm.h> 2012-09-21 12:45:26 -07:00
alternative.h Merge branch 'x86-smap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-10-01 13:59:17 -07:00
amd_nb.h x86, AMD, NB: Add multi-domain support 2013-01-10 16:17:58 +01:00
apb_timer.h
apic.h sections: fix section conflicts in arch/x86 2012-10-06 03:04:40 +09:00
apic_flat_64.h
apicdef.h
apm.h
arch_hweight.h
archrandom.h
asm-offsets.h
asm.h
atomic.h x86, 386 removal: Remove CONFIG_XADD 2012-11-29 13:23:02 -08:00
atomic64_32.h
atomic64_64.h
barrier.h
bios_ebda.h
bitops.h x86: Use REP BSF unconditionally 2012-09-19 17:26:08 +02:00
boot.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
bootparam_utils.h x86, doc: Be explicit about what the x86 struct boot_params requires 2013-03-06 20:34:43 -08:00
bug.h
bugs.h
cache.h
cacheflush.h
calgary.h
calling.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
ce4100.h
checksum.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
checksum_32.h
checksum_64.h
clocksource.h x86: pvclock: generic pvclock vsyscall initialization 2012-11-27 23:29:09 -02:00
cmpxchg.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
cmpxchg_32.h x86, 386 removal: Remove CONFIG_CMPXCHG 2012-11-29 13:23:01 -08:00
cmpxchg_64.h
compat.h compat: move compat_siginfo_t definition to asm/compat.h 2012-10-06 03:05:16 +09:00
context_tracking.h context_tracking: New context tracking susbsystem 2012-11-30 11:40:07 -08:00
cpu.h x86, topology: Debug CPU0 hotplug 2012-11-14 15:28:11 -08:00
cpu_device_id.h
cpufeature.h perf/x86/amd: Enable northbridge performance counters on AMD family 15h 2013-02-16 09:37:27 +01:00
cpumask.h
cputime.h
current.h
debugreg.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
delay.h
desc.h
desc_defs.h
device.h driver core / ACPI: Move ACPI support to core device and driver types 2012-11-15 00:28:00 +01:00
div64.h
dma-contiguous.h
dma-mapping.h dma-debug: New interfaces to debug dma mapping errors 2012-10-24 17:06:43 +02:00
dma.h
dmi.h
dwarf2.h
e820.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
edac.h
efi.h x86, efi: remove duplicate code in setup_arch() by using, efi_is_native() 2013-02-14 10:36:18 +00:00
elf.h mm: use vm_unmapped_area() on x86_64 architecture 2012-12-11 17:22:25 -08:00
emergency-restart.h
entry_arch.h
exec.h
fb.h
fixmap.h x86: pvclock: generic pvclock vsyscall initialization 2012-11-27 23:29:09 -02:00
floppy.h
fpu-internal.h x86: convert to ksignal 2013-02-14 09:21:17 -05:00
frame.h
ftrace.h tracing/syscalls: Allow archs to ignore tracing compat syscalls 2013-02-12 17:46:28 -05:00
futex.h x86, 386 removal: Remove CONFIG_BSWAP 2012-11-29 13:23:02 -08:00
gart.h
genapic.h
geode.h
gpio.h
hardirq.h x86: Distinguish TLB shootdown interrupts from other functions call interrupts 2012-09-27 22:52:34 -07:00
highmem.h
hpet.h x86, hpet: Introduce x86_msi_ops.setup_hpet_msi 2013-01-28 10:48:30 +01:00
hugetlb.h mm: hugetlb: add arch hook for clearing page flags before entering pool 2012-10-09 16:22:24 +09:00
hw_breakpoint.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
hw_irq.h x86, io-apic: Move CONFIG_IRQ_REMAP code out of x86 core 2013-01-28 12:17:27 +01:00
hypertransport.h
hypervisor.h x86/apic: Allow x2apic without IR on VMware platform 2013-01-24 13:11:18 +01:00
i387.h x86, kvm: fix kvm's usage of kernel_fpu_begin/end() 2012-09-21 16:59:04 -07:00
i8259.h
ia32.h x86: switch to generic old sigaction 2013-02-03 18:16:27 -05:00
ia32_unistd.h
idle.h
inat.h
inat_types.h
init.h x86, 64bit, mm: Add generic kernel/ident mapping helper 2013-01-29 15:12:25 -08:00
insn.h
inst.h
intel_scu_ipc.h
io.h
io_apic.h x86, io_apic: Introduce eoi_ioapic_pin call-back 2013-01-28 12:51:52 +01:00
iomap.h
iommu.h
iommu_table.h x86/iommu: Use NULL instead of plain 0 for __IOMMU_INIT 2012-09-05 10:52:26 +02:00
ipi.h
irq.h
irq_regs.h
irq_remapping.h x86, irq: Move irq_remapped out of x86 core code 2013-01-28 12:51:52 +01:00
irq_vectors.h X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts 2013-02-12 16:27:15 -08:00
irqflags.h
ist.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
jump_label.h
kbdleds.h
kdebug.h
kexec.h x86, kexec: Remove 1024G limitation for kexec buffer on 64bit 2013-01-29 15:26:23 -08:00
kgdb.h
kmap_types.h
kmemcheck.h
kprobes.h kprobes/x86: Check Interrupt Flag modifier when registering probe 2013-03-18 10:21:23 +01:00
kvm_emulate.h KVM: emulator: optimize "rep ins" handling 2012-09-06 18:07:38 +03:00
kvm_guest.h x86: kvm guest: pvclock vsyscall support 2012-11-27 23:29:10 -02:00
kvm_host.h KVM: x86: Convert MSR_KVM_SYSTEM_TIME to use gfn_to_hva_cache functions (CVE-2013-1797) 2013-03-19 14:17:35 -03:00
kvm_para.h Merge tag 'kvm-3.9-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2013-02-24 13:07:18 -08:00
lguest.h
lguest_hcall.h
linkage.h ix86: Tighten asmlinkage_protect() constraints 2013-01-24 11:25:59 +01:00
local.h x86, 386 removal: Remove CONFIG_XADD 2012-11-29 13:23:02 -08:00
local64.h
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h
mce.h x86, MCE: Retract most UAPI exports 2013-01-09 14:49:02 +01:00
microcode.h x86/microcode_core_early.c: Define interfaces for early loading ucode 2013-01-31 13:19:12 -08:00
microcode_intel.h x86/microcode_intel.h: Define functions and macros for early loading ucode 2013-01-31 13:18:50 -08:00
mmconfig.h
mmu.h
mmu_context.h
mmx.h
mmzone.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
mmzone_32.h x86-32, mm: Remove reference to resume_map_numa_kva() 2013-01-31 14:12:30 -08:00
mmzone_64.h
module.h x86, 386 removal: Remove CONFIG_M386 from Kconfig 2012-11-29 13:23:01 -08:00
mpspec.h
mpspec_def.h
mrst-vrtc.h
mrst.h
mshyperv.h X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts 2013-02-12 16:27:15 -08:00
msidef.h
msr.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
mtrr.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
mutex.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
mutex_32.h
mutex_64.h
mwait.h intel_idle: remove assumption of one C-state per MWAIT flag 2013-02-08 19:29:16 -05:00
nmi.h
nops.h
numa.h cpu-hotplug,memory-hotplug: clear cpu_to_node() when offlining the node 2013-02-23 17:50:13 -08:00
numa_32.h
numaq.h
olpc.h x86: OLPC: switch over to using new EC driver on x86 2012-07-31 23:27:30 -04:00
olpc_ofw.h
page.h Merge remote-tracking branch 'origin/x86/mm' into x86/mm2 2013-02-01 02:28:36 -08:00
page_32.h x86: Make it so that __pa_symbol can only process kernel symbols on x86_64 2012-11-16 16:42:09 -08:00
page_32_types.h
page_64.h x86: Make it so that __pa_symbol can only process kernel symbols on x86_64 2012-11-16 16:42:09 -08:00
page_64_types.h x86: Move some contents of page_64_types.h into pgtable_64.h and page_64.h 2012-11-16 16:40:34 -08:00
page_types.h x86, mm: Move min_pfn_mapped back to mm/init.c 2012-11-17 11:59:24 -08:00
paravirt.h x86, paravirt: fix build error when thp is disabled 2012-12-18 09:49:03 -08:00
paravirt_types.h
parport.h X86: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
pat.h
pci-direct.h
pci-functions.h
pci.h PCI changes for the v3.9 merge window: 2013-02-25 21:18:18 -08:00
pci_64.h
pci_x86.h PCI changes for the v3.9 merge window: 2013-02-25 21:18:18 -08:00
percpu.h x86, 386 removal: Remove CONFIG_CMPXCHG 2012-11-29 13:23:01 -08:00
perf_event.h perf/x86/amd: Enable northbridge performance counters on AMD family 15h 2013-02-16 09:37:27 +01:00
perf_event_p4.h
pgalloc.h
pgtable-2level.h
pgtable-2level_types.h
pgtable-3level.h
pgtable-3level_types.h
pgtable.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-21 18:06:55 -08:00
pgtable_32.h x86/mm: Convert update_mmu_cache() and update_mmu_cache_pmd() to functions 2013-01-24 16:12:13 +01:00
pgtable_32_types.h
pgtable_64.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-21 18:06:55 -08:00
pgtable_64_types.h x86, 64bit: Use a #PF handler to materialize early mappings on demand 2013-01-29 15:20:06 -08:00
pgtable_types.h memory-hotplug: common APIs to support page tables hot-remove 2013-02-23 17:50:12 -08:00
posix_types.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
probe_roms.h
processor-cyrix.h
processor-flags.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
processor.h Merge branch 'x86/microcode' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-22 19:22:52 -08:00
prom.h
proto.h x86-64: don't set the early IDT to point directly to 'early_idt_handler' 2013-02-22 13:09:51 -08:00
ptrace.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-12-20 18:05:28 -08:00
pvclock-abi.h
pvclock.h x86: pvclock: generic pvclock vsyscall initialization 2012-11-27 23:29:09 -02:00
realmode.h x86, realmode: Separate real_mode reserve and setup 2013-01-29 15:13:24 -08:00
reboot.h
reboot_fixups.h
required-features.h x86: Require MOVBE feature in cpuid when we use it 2013-01-28 16:59:55 -08:00
resume-trace.h
rio.h
rtc.h
rwlock.h
rwsem.h
scatterlist.h
seccomp.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
seccomp_32.h
seccomp_64.h
sections.h
segment.h
serial.h
setup.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
setup_arch.h
shmparam.h
sigcontext.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
sigframe.h
sighandling.h
signal.h x86: switch to generic old sigaction 2013-02-03 18:16:27 -05:00
smap.h x86, smap: Add STAC and CLAC instructions to control user space access 2012-09-21 12:45:27 -07:00
smp.h x86, hotplug: Support functions for CPU0 online/offline 2012-11-14 09:39:48 -08:00
smpboot_hooks.h
sparsemem.h
special_insns.h
spinlock.h x86/spinlocks: Fix comment in spinlock.h 2012-08-22 09:52:47 +02:00
spinlock_types.h
sta2x11.h
stackprotector.h
stacktrace.h
string.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
string_32.h
string_64.h
suspend.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
suspend_32.h
suspend_64.h
svm.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
swiotlb.h
switch_to.h
sync_bitops.h
sys_ia32.h switch lseek to COMPAT_SYSCALL_DEFINE 2013-02-24 10:52:26 -05:00
syscall.h x86: remove the x32 syscall bitmask from syscall_get_nr() 2013-04-02 14:38:09 -07:00
syscalls.h x86: switch to generic old sigaction 2013-02-03 18:16:27 -05:00
tce.h
thread_info.h tracing/syscalls: Allow archs to ignore tracing compat syscalls 2013-02-12 17:46:28 -05:00
time.h
timer.h
timex.h
tlb.h
tlbflush.h x86/tlbflush.h: Define __native_flush_tlb_global_irq_disabled() 2013-01-31 13:19:16 -08:00
topology.h
trace_clock.h tracing: Format non-nanosec times from tsc clock without a decimal point. 2012-11-13 15:48:40 -05:00
traps.h
tsc.h
uaccess.h x86, doc: Clarify the use of asm("%edx") in uaccess.h 2013-02-12 15:37:02 -08:00
uaccess_32.h x86, uaccess: Merge prototypes for clear_user/__clear_user 2012-09-21 12:45:26 -07:00
uaccess_64.h x86, uaccess: Merge prototypes for clear_user/__clear_user 2012-09-21 12:45:26 -07:00
unaligned.h
unistd.h burying unused conditionals 2013-02-14 09:21:15 -05:00
uprobes.h uprobes: Make arch_uprobe_task->saved_trap_nr "unsigned int" 2012-09-15 17:37:32 +02:00
user.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
user32.h
user_32.h
user_64.h
vdso.h x86/vdso: Add __user annotation to VDSO32_SYMBOL 2012-09-05 10:52:23 +02:00
vga.h
vgtod.h time: Convert x86_64 to using new update_vsyscall 2012-09-24 12:38:09 -04:00
virtext.h
vm86.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
vmx.h Merge tag 'kvm-3.9-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2013-02-24 13:07:18 -08:00
vsyscall.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
vvar.h
word-at-a-time.h
x2apic.h
x86_init.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-21 18:06:55 -08:00
xcr.h
xor.h x86/xor: Add alternative SSE implementation only prefetching once per 64-byte line 2013-01-25 09:23:50 +01:00
xor_32.h x86/xor: Add alternative SSE implementation only prefetching once per 64-byte line 2013-01-25 09:23:50 +01:00
xor_64.h x86/xor: Add alternative SSE implementation only prefetching once per 64-byte line 2013-01-25 09:23:50 +01:00
xor_avx.h x86, fpu: always use kernel_fpu_begin/end() for in-kernel FPU usage 2012-09-18 15:52:08 -07:00
xsave.h Merge branch 'x86/fpu' into x86/smap 2012-09-21 17:18:44 -07:00