WSL2-Linux-Kernel/arch/ia64/include/asm
H. Peter Anvin c41d68a513 compat: Make compat_alloc_user_space() incorporate the access_ok()
compat_alloc_user_space() expects the caller to independently call
access_ok() to verify the returned area.  A missing call could
introduce problems on some architectures.

This patch incorporates the access_ok() check into
compat_alloc_user_space() and also adds a sanity check on the length.
The existing compat_alloc_user_space() implementations are renamed
arch_compat_alloc_user_space() and are used as part of the
implementation of the new global function.

This patch assumes NULL will cause __get_user()/__put_user() to either
fail or access userspace on all architectures.  This should be
followed by checking the return value of compat_access_user_space()
for NULL in the callers, at which time the access_ok() in the callers
can also be removed.

Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Tony Luck <tony.luck@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <jejb@parisc-linux.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: <stable@kernel.org>
2010-09-14 16:08:45 -07:00
..
native ia64/pv_ops: paravirtualize gate.S. 2009-03-26 11:01:46 -07:00
sn tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
uv sgi-gru: add macros for using the UV hub to send interrupts 2009-04-02 19:05:05 -07:00
xen xen: Remove unnecessary arch specific xen irq functions. 2010-02-18 17:17:58 -08:00
Kbuild archs: replace unifdef-y with header-y 2010-08-14 22:26:51 +02:00
acpi-ext.h ACPI: remove private acpica headers from driver files 2008-12-31 01:15:22 -05:00
acpi.h ACPI: delete the "acpi=ht" boot option 2010-03-14 20:58:38 -04:00
agp.h agp: kill phys_to_gart() and gart_to_phys() 2009-08-03 09:05:00 +01:00
asm-offsets.h kbuild: move asm-offsets.h to include/generated 2009-12-12 13:08:14 +01:00
asmmacro.h Rename .data..patch.XXX to .data..patch.XXX. 2010-03-03 11:25:59 +01:00
atomic.h [IA64] Fix 64-bit atomic routines to return "long" 2010-08-13 16:41:07 -07:00
auxvec.h
bitops.h bitops: Optimize hweight() by making use of compile-time evaluation 2010-04-06 15:52:11 -07:00
bitsperlong.h asm-generic: introduce asm/bitsperlong.h 2009-06-11 21:02:14 +02:00
break.h ia64/xen: reserve "break" numbers used for xen hypercalls. 2008-10-17 09:52:52 -07:00
bug.h
bugs.h
byteorder.h byteorder: make swab.h include asm/swab.h like a regular header 2009-01-14 19:56:50 -08:00
cache.h Rename .data.read_mostly to .data..read_mostly. 2010-03-03 11:26:00 +01:00
cacheflush.h block: add helpers to run flush_dcache_page() against a bio and a request's pages 2009-11-26 09:16:19 +01:00
checksum.h
compat.h compat: Make compat_alloc_user_space() incorporate the access_ok() 2010-09-14 16:08:45 -07:00
cpu.h
cputime.h cputime: Optimize jiffies_to_cputime(1) 2009-08-03 14:48:36 +02:00
current.h
cyclone.h
delay.h
device.h Driver Core: Add platform device arch data V3 2009-07-22 00:28:38 +02:00
div64.h
dma-mapping.h dma-mapping: remove dma_is_consistent API 2010-08-11 08:59:21 -07:00
dma.h
dmi.h 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
elf.h elf coredump: replace ELF_CORE_EXTRA_* macros by functions 2010-03-06 11:26:45 -08:00
emergency-restart.h
errno.h
esi.h
fb.h
fcntl.h
fpswa.h
fpu.h Revert "Neither asm/types.h nor linux/types.h is required for arch/ia64/include/asm/fpu.h" 2009-07-17 06:35:05 -07:00
ftrace.h [IA64] sanity in #include files. Move fnptr to types.h 2010-01-06 15:52:35 -08:00
futex.h
gcc_intrin.h [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
hardirq.h preempt-count: force hardirq-count to max of 10 2009-02-12 11:19:05 -05:00
hpsim.h
hugetlb.h
hw_irq.h [IA64] preallocate IA64_IRQ_MOVE_VECTOR 2009-12-14 16:03:36 -08:00
ia64regs.h
idle.h [IA64] xen_domu_defconfig: fix build issues/warnings 2009-05-05 11:43:13 -07:00
intel_intrin.h
intrinsics.h Pull pvops into release branch 2009-03-31 14:25:08 -07:00
io.h implement early_io{re,un}map for ia64 2009-12-16 02:45:10 +00:00
ioctl.h
ioctls.h tty: Add EXTPROC support for LINEMODE 2010-08-10 13:47:39 -07:00
iommu.h intel-iommu: Fix one last ia64 build problem in Pass Through Support 2009-06-05 20:49:53 +01:00
iosapic.h
ipcbuf.h
irq.h ia64: move nr-irqs.h to include/generated 2009-12-12 13:08:14 +01:00
irq_regs.h
kdebug.h
kexec.h kexec jump: rename KEXEC_CONTROL_CODE_SIZE to KEXEC_CONTROL_PAGE_SIZE 2008-08-15 08:35:42 -07:00
kmap_types.h kmap_types: make most arches use generic header file 2009-06-16 19:47:51 -07:00
kprobes.h [IA64] sanity in #include files. Move fnptr to types.h 2010-01-06 15:52:35 -08:00
kregs.h [IA64] Fix annoying IA64_TR_ALLOC_MAX message. 2008-10-17 13:47:53 -07:00
kvm.h KVM: Maintain back mapping from irqchip/pin to gsi 2009-12-03 09:32:07 +02:00
kvm_host.h KVM: Remove unnecessary divide operations 2010-08-01 10:47:30 +03:00
kvm_para.h KVM: Add __KERNEL__ guards to exported headers 2009-09-10 10:46:48 +03:00
libata-portmap.h
linkage.h
local.h
local64.h arch: Implement local64_t 2010-06-09 11:12:36 +02:00
machvec.h Merge branch 'linus' into core/iommu 2009-01-16 10:09:10 +01:00
machvec_dig.h
machvec_dig_vtd.h remove dma operations in struct ia64_machine_vector 2009-01-06 14:06:50 +01:00
machvec_hpsim.h
machvec_hpzx1.h remove dma operations in struct ia64_machine_vector 2009-01-06 14:06:50 +01:00
machvec_hpzx1_swiotlb.h remove hwsw_dma_ops 2009-01-06 14:06:52 +01:00
machvec_init.h [IA64] SN specific version of dma_get_required_mask() 2009-01-15 10:42:16 -08:00
machvec_sn2.h Merge branch 'linus' into core/iommu 2009-01-16 10:09:10 +01:00
machvec_uv.h
machvec_xen.h ia64/xen: define xen machine vector for domU. 2008-10-17 10:08:56 -07:00
mc146818rtc.h
mca.h [IA64] Save I-resources to ia64_sal_os_state 2009-12-14 16:37:58 -08:00
mca_asm.h
meminit.h ia64: don't alias VMALLOC_END to vmalloc_end 2009-10-02 13:28:55 +09:00
mman.h mm: remove duplicate asm/mman.h files 2009-09-22 07:17:42 -07:00
mmu.h
mmu_context.h cpumask: use mm_cpumask() wrapper: ia64 2009-03-16 14:12:48 +10:30
mmzone.h [IA64] removing redundant ifdef 2010-05-18 14:45:52 -07:00
module.h ia64/pv_ops/bp/module: support binary patching for kernel module. 2009-03-26 11:02:51 -07:00
msgbuf.h
msidef.h ia64: Move the macro definitions related to MSI to one header file. 2009-03-24 11:03:12 +02:00
mutex.h
nodedata.h
numa.h hugetlb: add generic definition of NUMA_NO_NODE 2009-12-15 08:53:12 -08:00
page.h [IA64] increase ia64 static per cpu area 2010-07-27 14:55:12 -07:00
pal.h [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
param.h
paravirt.h ia64/pv_ops: implement binary patching optimization for native. 2009-03-26 11:02:42 -07:00
paravirt_patch.h ia64/pv_op/binarypatch: add helper functions to support binary patching for paravirt_ops. 2009-03-26 11:02:31 -07:00
paravirt_privop.h [IA64] fix allmodconfig compilation breakage. 2009-04-20 09:46:29 -07:00
parport.h
patch.h
pci.h pci-dma: add linux/pci-dma.h to linux/pci.h 2010-03-12 15:52:42 -08:00
percpu.h Merge branch 'for-35' of git://repo.or.cz/linux-kbuild 2010-06-01 08:55:52 -07:00
perfmon.h
perfmon_default_smpl.h tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
pgalloc.h mm: Pass virtual address to [__]p{te,ud,md}_free_tlb() 2009-07-27 12:10:38 -07:00
pgtable.h MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself 2010-02-20 16:41:46 +00:00
poll.h
posix_types.h
processor.h [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
ptrace.h ptrace: move user_enable_single_step & co prototypes to linux/ptrace.h 2010-03-12 15:52:38 -08:00
ptrace_offsets.h
pvclock-abi.h ia64/xen: add a necessary header file to compile include/xen/interface/xen.h 2008-10-17 09:57:28 -07:00
resource.h
rse.h
rwsem.h [IA64] Fix rwsem: RWSEM_WAITING_BIAS must not be unsigned. 2010-08-12 09:14:56 -07:00
sal.h [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
scatterlist.h remove needless ISA_DMA_THRESHOLD 2010-08-07 18:15:50 +02:00
sections.h [IA64] Put the space for cpu0 per-cpu area into .data section 2008-09-29 16:39:19 -07:00
segment.h
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h signals: demultiplexing SIGTRAP signal 2008-09-23 13:26:52 +02:00
signal.h asm-generic: rename termios.h, signal.h and mman.h 2009-06-11 21:01:52 +02:00
smp.h cpumask: remove arch_send_call_function_ipi 2009-09-24 09:34:47 +09:30
socket.h net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
sockios.h
sparsemem.h
spinlock.h locking: Convert raw_rwlock functions to arch_rwlock 2009-12-14 23:55:32 +01:00
spinlock_types.h locking: Convert raw_rwlock to arch_rwlock 2009-12-14 23:55:32 +01:00
stat.h
statfs.h IA64: Use <asm-generic/statfs.h> 2008-09-04 09:46:13 +01:00
string.h
swab.h headers_check fix: ia64, swab.h 2009-02-01 11:01:25 +05:30
swiotlb.h swiotlb: Remove duplicate swiotlb_force extern declarations 2009-11-15 09:03:10 +01:00
sync_bitops.h ia64/xen: introduce sync bitops which is necessary for ia64/xen support. 2008-10-17 09:53:33 -07:00
syscall.h [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
system.h [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
termbits.h tty: Add EXTPROC support for LINEMODE 2010-08-10 13:47:39 -07:00
termios.h
thread_info.h add descriptive comment for TIF_MEMDIE task flag declaration. 2010-05-14 11:13:27 +02:00
timex.h ia64/pv_ops/pv_time_ops: add sched_clock hook. 2009-03-26 10:50:42 -07:00
tlb.h [IA64] __per_cpu_idtrs[] is a memory hog 2010-01-07 16:10:57 -08:00
tlbflush.h
topology.h numa: ia64: use generic percpu var numa_node_id() implementation 2010-05-27 09:12:57 -07:00
types.h [IA64] move fnptr definition inside #ifdef __KERNEL__ 2010-01-08 10:53:28 -08:00
uaccess.h
ucontext.h
unaligned.h
uncached.h
unistd.h [IA64] Fix build error: conflicting types for ‘sys_execve’ 2010-08-18 10:17:44 -07:00
unwind.h
user.h
ustack.h
vga.h
xor.h