linux-kernel-test/arch/ia64/include/asm
Eric Paris d7e7528bcd Audit: push audit success and retcode into arch ptrace.h
The audit system previously expected arches calling to audit_syscall_exit to
supply as arguments if the syscall was a success and what the return code was.
Audit also provides a helper AUDITSC_RESULT which was supposed to simplify things
by converting from negative retcodes to an audit internal magic value stating
success or failure.  This helper was wrong and could indicate that a valid
pointer returned to userspace was a failed syscall.  The fix is to fix the
layering foolishness.  We now pass audit_syscall_exit a struct pt_reg and it
in turns calls back into arch code to collect the return value and to
determine if the syscall was a success or failure.  We also define a generic
is_syscall_success() macro which determines success/failure based on if the
value is < -MAX_ERRNO.  This works for arches like x86 which do not use a
separate mechanism to indicate syscall failure.

We make both the is_syscall_success() and regs_return_value() static inlines
instead of macros.  The reason is because the audit function must take a void*
for the regs.  (uml calls theirs struct uml_pt_regs instead of just struct
pt_regs so audit_syscall_exit can't take a struct pt_regs).  Since the audit
function takes a void* we need to use static inlines to cast it back to the
arch correct structure to dereference it.

The other major change is that on some arches, like ia64, MIPS and ppc, we
change regs_return_value() to give us the negative value on syscall failure.
THE only other user of this macro, kretprobe_example.c, won't notice and it
makes the value signed consistently for the audit functions across all archs.

In arch/sh/kernel/ptrace_64.c I see that we were using regs[9] in the old
audit code as the return value.  But the ptrace_64.h code defined the macro
regs_return_value() as regs[3].  I have no idea which one is correct, but this
patch now uses the regs_return_value() function, so it now uses regs[3].

For powerpc we previously used regs->result but now use the
regs_return_value() function which uses regs->gprs[3].  regs->gprs[3] is
always positive so the regs_return_value(), much like ia64 makes it negative
before calling the audit code when appropriate.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: H. Peter Anvin <hpa@zytor.com> [for x86 portion]
Acked-by: Tony Luck <tony.luck@intel.com> [for ia64]
Acked-by: Richard Weinberger <richard@nod.at> [for uml]
Acked-by: David S. Miller <davem@davemloft.net> [for sparc]
Acked-by: Ralf Baechle <ralf@linux-mips.org> [for mips]
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [for ppc]
2012-01-17 16:16:56 -05:00
..
native
sn treewide: fix potentially dangerous trailing ';' in #defined values/expressions 2011-07-21 14:10:00 +02:00
uv
xen xen/ia64: fix build breakage because of conflicting u64 guest handles 2011-11-30 13:40:03 -05:00
acpi-ext.h
acpi.h ACPI / PM: Merge do_suspend_lowlevel() into acpi_save_state_mem() 2011-02-24 19:58:54 +01: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 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
auxvec.h
bitops.h asm-generic: add another generic ext2 atomic bitops 2011-07-26 16:49:46 -07:00
bitsperlong.h asm-generic: introduce asm/bitsperlong.h 2009-06-11 21:02:14 +02:00
break.h
bug.h
bugs.h
byteorder.h
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
clocksource.h clocksource: Change __ARCH_HAS_CLOCKSOURCE_DATA to a CONFIG option 2011-07-21 13:34:05 -07:00
cpu.h
cputime.h Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-01-06 08:44:54 -08:00
current.h
cyclone.h
delay.h
device.h iommu: Rename the DMAR and INTR_REMAP config options 2011-09-21 10:22:03 +02:00
div64.h
dma-mapping.h [IA64] Add DMA_ERROR_CODE define. 2011-01-11 11:55:06 -08: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 futex: Sanitize futex ops argument types 2011-03-11 12:23:31 +01:00
gcc_intrin.h [IA64] Convert ia64 to use int-ll64.h 2009-06-17 09:33:49 -07:00
gpio.h [IA64] Hook up gpiolib support 2011-06-01 13:44:06 -07:00
hardirq.h [IA64] Move local_softirq_pending() definition 2010-10-19 13:31:11 +02:00
hpsim.h
hugetlb.h
hw_irq.h ia64: Remove redundant declaration of irq_desc[] 2011-03-29 14:48:05 +02: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
io.h ACPI: Use ioremap_cache() 2011-01-07 01:04:19 -05:00
ioctl.h
ioctls.h ioctl: Use asm-generic/ioctls.h on ia64 (enables termiox) 2010-10-22 10:20:00 -07:00
iommu_table.h ia64, iommu: Add a dummy iommu_table.h file in IA64. 2010-10-08 13:11:11 -07:00
iommu.h iommu: Add option to group multi-function devices 2011-11-15 12:22:31 +01:00
iosapic.h
ipcbuf.h consolidate a bunch of ipcbuf.h instances 2012-01-03 22:55:18 -05:00
irq_regs.h
irq.h ia64: move nr-irqs.h to include/generated 2009-12-12 13:08:14 +01:00
irqflags.h Fix IRQ flag handling naming 2010-10-07 14:08:55 +01:00
Kbuild archs: replace unifdef-y with header-y 2010-08-14 22:26:51 +02:00
kdebug.h
kexec.h
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
kvm_host.h KVM: Clean up vm creation and release 2011-01-12 11:29:09 +02:00
kvm_para.h KVM: Add __KERNEL__ guards to exported headers 2009-09-10 10:46:48 +03:00
kvm.h KVM: Maintain back mapping from irqchip/pin to gsi 2009-12-03 09:32:07 +02:00
libata-portmap.h
linkage.h
local64.h arch: Implement local64_t 2010-06-09 11:12:36 +02:00
local.h
machvec_dig_vtd.h
machvec_dig.h
machvec_hpsim.h
machvec_hpzx1_swiotlb.h
machvec_hpzx1.h
machvec_init.h
machvec_sn2.h
machvec_uv.h
machvec_xen.h
machvec.h
mc146818rtc.h
mca_asm.h
mca.h [IA64] Save I-resources to ia64_sal_os_state 2009-12-14 16:37:58 -08:00
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_context.h
mmu.h
mmzone.h [IA64] removing redundant ifdef 2010-05-18 14:45:52 -07:00
module.h
msgbuf.h
msidef.h
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] fix ia64 build failure in pmdp_get_and_clear 2011-01-14 10:56:38 -08:00
pal.h Fix common misspellings 2011-03-31 11:26:23 -03:00
param.h
paravirt_patch.h
paravirt_privop.h
paravirt.h ia64: add jump labels for paravirt 2011-07-14 12:59:45 +03:00
parport.h
patch.h
pci.h PCI: IA64: convert pcibios_set_master() to a non-inlined function 2012-01-06 12:10:37 -08:00
percpu.h Merge branch 'for-35' of git://repo.or.cz/linux-kbuild 2010-06-01 08:55:52 -07:00
perfmon_default_smpl.h Fix common misspellings 2011-03-31 11:26:23 -03:00
perfmon.h fix typos 'comamnd' -> 'command' in comments 2011-02-02 11:31:21 +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: remove pte_*map_nested() 2010-10-26 16:52:08 -07:00
poll.h
posix_types.h
processor.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ptrace_offsets.h
ptrace.h Audit: push audit success and retcode into arch ptrace.h 2012-01-17 16:16:56 -05:00
pvclock-abi.h
resource.h
rse.h
rwsem.h rwsem: Move duplicate function prototypes to linux/rwsem.h 2011-01-27 12:30:39 +01: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
segment.h
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h Add _addr_lsb field to ia64 siginfo 2010-10-12 09:37:10 +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: add wireless TX status socket option 2011-11-09 16:01:02 -05:00
sockios.h
sparsemem.h
spinlock_types.h locking: Convert raw_rwlock to arch_rwlock 2009-12-14 23:55:32 +01:00
spinlock.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
stat.h
statfs.h
string.h
swab.h
swiotlb.h swiotlb: Remove duplicate swiotlb_force extern declarations 2009-11-15 09:03:10 +01:00
sync_bitops.h
syscall.h [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
system.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-irqflags 2010-10-21 14:37:27 -07:00
termbits.h tty: Add EXTPROC support for LINEMODE 2010-08-10 13:47:39 -07:00
termios.h
thread_info.h freezer: remove now unused TIF_FREEZE 2011-11-21 12:32:25 -08:00
timex.h
tlb.h ia64: mmu_gather rework 2011-05-25 08:39:15 -07: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 consolidate umode_t declarations 2012-01-03 22:55:17 -05:00
uaccess.h
ucontext.h
unaligned.h
uncached.h
unistd.h [IA64] Wire up cross memory attach syscalls 2011-11-02 14:00:26 -07:00
unwind.h
user.h
ustack.h
vga.h
xor.h