alistair23-linux/arch/mips/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
..
dec Fix common misspellings 2011-03-31 11:26:23 -03:00
emma
fw
ip32 net: meth: Add set_rx_mode hook to fix ICMPv6 neighbor discovery 2011-12-27 13:17:34 -05:00
lasat doc: fix broken references 2011-09-27 18:08:04 +02:00
mach-ar7 MIPS: AR7: Fix loops per jiffies on TNETD7200 devices 2010-12-16 18:10:56 +00:00
mach-ath79 MIPS: ath79: add common WMAC device for AR913X based boards 2011-01-18 19:30:28 +01:00
mach-au1x00 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2011-11-03 13:28:14 -07:00
mach-bcm47xx MIPS: BCM47xx: fix build with GENERIC_GPIO configuration 2011-11-08 12:35:29 +00:00
mach-bcm63xx MIPS: BCM63XX: bcm963xx_tag.h: make crc fields integers 2012-01-09 18:23:30 +00:00
mach-cavium-octeon MIPS: Octeon: Enable C0_UserLocal probing. 2011-09-24 01:44:41 +02:00
mach-cobalt
mach-db1x00 MIPS: Alchemy: clean DMA code of CONFIG_SOC_AU1??? defines 2011-10-24 23:34:24 +01:00
mach-dec
mach-emma2rh
mach-generic MIPS: Remove pointless return statement from empty void functions. 2011-07-25 17:26:55 +01:00
mach-ip22
mach-ip27 MIPS: Remove pointless return statement from empty void functions. 2011-07-25 17:26:55 +01:00
mach-ip28
mach-ip32 Fix common misspellings 2011-03-31 11:26:23 -03:00
mach-jazz MIPS: Remove pointless return statement from empty void functions. 2011-07-25 17:26:55 +01:00
mach-jz4740 MIPS: static should be at beginning of declaration 2011-07-11 14:13:46 +02:00
mach-lantiq MIPS: Lantiq: Add ethernet driver 2011-05-19 09:55:43 +01:00
mach-lasat
mach-loongson MIPS: Remove pointless return statement from empty void functions. 2011-07-25 17:26:55 +01:00
mach-malta MIPS: Enable cpu_has_clo_clz for MIPS Technologies' platforms 2011-07-25 17:26:55 +01:00
mach-mipssim MIPS: Enable cpu_has_clo_clz for MIPS Technologies' platforms 2011-07-25 17:26:55 +01:00
mach-netlogic MIPS: Netlogic: mach-netlogic include files 2011-05-19 09:55:39 +01:00
mach-pb1x00 MIPS: Alchemy: clean DMA code of CONFIG_SOC_AU1??? defines 2011-10-24 23:34:24 +01:00
mach-pnx833x
mach-pnx8550
mach-powertv MIPS: Remove unneeded version.h includes from arch/mips/ 2011-09-17 02:40:36 +02:00
mach-rc32434
mach-rm
mach-sibyte
mach-tx39xx MIPS: Move FIXADDR_TOP into spaces.h 2011-07-25 17:26:53 +01:00
mach-tx49xx MIPS: Move FIXADDR_TOP into spaces.h 2011-07-25 17:26:53 +01:00
mach-vr41xx
mach-wrppmc
mach-yosemite
mips-boards MIPS: GIC: Remove dependencies from Malta files. 2010-10-04 18:33:56 +01:00
netlogic MIPS: XLR, XLS: Add PCI support. 2011-05-19 09:55:41 +01:00
octeon Fix common misspellings 2011-03-31 11:26:23 -03:00
pci Fix common misspellings 2011-03-31 11:26:23 -03:00
pmc-sierra/msp71xx Fix common misspellings 2011-03-31 11:26:23 -03:00
sgi Fix common misspellings 2011-03-31 11:26:23 -03:00
sibyte Fix common misspellings 2011-03-31 11:26:23 -03:00
sn Fix common misspellings 2011-03-31 11:26:23 -03:00
txx9
vr41xx
xtalk
abi.h
addrspace.h
amon.h
arch_hweight.h
asm-offsets.h
asm.h
asmmacro-32.h update David Miller's old email address 2011-04-06 06:19:38 -07:00
asmmacro-64.h update David Miller's old email address 2011-04-06 06:19:38 -07:00
asmmacro.h
atomic.h atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
auxvec.h
barrier.h
bcache.h
bitops.h bitops: remove minix bitops from asm/bitops.h 2011-03-23 19:46:22 -07:00
bitsperlong.h
bootinfo.h MIPS: Add a platform hook for swiotlb setup. 2010-10-29 19:08:32 +01:00
branch.h
break.h
bug.h
bugs.h
byteorder.h
cache.h MIPS: Rename .data..mostly and properly handle it in linker script 2011-05-10 18:15:24 +01:00
cachectl.h
cacheflush.h MIPS: cache: Provide cache flush operations for XFS 2011-10-20 15:00:18 +01:00
cacheops.h
cevt-r4k.h MIPS: MSP: Fix build error 2011-05-10 18:15:24 +01:00
checksum.h
clock.h
cmp.h
cmpxchg.h MIPS: Get rid of branches to .subsections. 2010-10-29 19:08:24 +01:00
compat-signal.h
compat.h compat: sync compat_stats with statfs. 2011-10-28 14:58:53 +02:00
compiler.h
cop2.h MIPS: Don't place cu2 notifiers in __cpuinitdata 2010-10-04 18:34:00 +01:00
cpu-features.h
cpu-info.h MIPS: Probe for presence of KScratch registers. 2011-01-18 19:30:22 +01:00
cpu.h MIPS: Add more CPU identifiers for Octeon II CPUs. 2011-10-24 23:34:25 +01:00
cputime.h
current.h
debug.h
delay.h
device.h MIPS: Convert DMA to use dma-mapping-common.h 2010-10-29 19:08:31 +01:00
div64.h
dma-mapping.h MIPS: Kludge IP27 build for 2.6.39. 2011-05-18 14:18:27 +01:00
dma.h MIPS: Allow MAX_DMA32_PFN to be overridden. 2010-10-29 19:08:28 +01:00
ds1287.h
dsp.h
edac.h
elf.h MIPS: Don't clobber personality high bits. 2010-12-16 18:10:54 +00:00
emergency-restart.h
errno.h mm: make __get_user_pages return -EHWPOISON for HWPOISON page optionally 2011-03-17 13:08:27 -03:00
fb.h
fcntl.h MIPS: 32-bit: Fix build failure in asm/fcntl.h 2010-10-18 16:59:04 +01:00
fixmap.h MIPS: Move FIXADDR_TOP into spaces.h 2011-07-25 17:26:53 +01:00
floppy.h treewide: fix potentially dangerous trailing ';' in #defined values/expressions 2011-07-21 14:10:00 +02:00
fpregdef.h
fpu.h
fpu_emulator.h
ftrace.h
futex.h futex: Sanitize futex ops argument types 2011-03-11 12:23:31 +01:00
gcmpregs.h
gic.h MIPS: GIC: Remove dependencies from Malta files. 2010-10-04 18:33:56 +01:00
gpio.h
gt64120.h MIPS: GT64120: Remove useless inclusion of clocksource.h. 2011-07-20 23:12:10 +01:00
hardirq.h
hazards.h
highmem.h mm: stack based kmap_atomic() 2010-10-26 16:52:08 -07:00
hugetlb.h MIPS: Invalidate old TLB mappings when updating huge page PTEs. 2011-05-10 18:15:26 +01:00
hw_irq.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
i8259.h
ide.h
inst.h MIPS: Add LDX and LWX instructions to uasm. 2011-01-18 19:30:23 +01:00
io.h Revert "MIPS: LD/SD o32 macro GAS fix update" 2011-10-20 15:00:19 +01:00
ioctl.h
ioctls.h tty: add TIOCVHANGUP to allow clean tty shutdown of all ttys 2011-02-17 14:16:30 -08:00
ipcbuf.h consolidate a bunch of ipcbuf.h instances 2012-01-03 22:55:18 -05:00
irq.h MIPS: Remove pointless return statement from empty void functions. 2011-07-25 17:26:55 +01:00
irq_cpu.h
irq_gt641xx.h
irq_regs.h
irqflags.h Fix common misspellings 2011-03-31 11:26:23 -03:00
isadep.h
jazz.h
jazzdma.h
jump_label.h jump label: Introduce static_branch() interface 2011-04-04 12:48:08 -04:00
Kbuild
kdebug.h
kexec.h
kgdb.h
kmap_types.h
kprobes.h
kspd.h
linkage.h
local.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
local64.h
m48t37.h
mc146818-time.h set_rtc_mmss: show warning message only once 2011-01-13 08:03:07 -08:00
mc146818rtc.h
mips_machine.h MIPS: Add generic support for multiple machines within a single kernel 2011-01-18 19:30:21 +01:00
mips_mt.h
mipsmtregs.h
mipsprom.h MIPS: SNI: Fix conflicting wrapper symbols for headers. 2011-10-20 15:00:18 +01:00
mipsregs.h MIPS: Add accessor macros for 64-bit performance counter registers. 2011-10-24 23:34:26 +01:00
mman.h thp: mm: define MADV_NOHUGEPAGE 2011-01-13 17:32:47 -08:00
mmu.h
mmu_context.h MIPS: Use C0_KScratch (if present) to hold PGD pointer. 2011-01-18 19:30:22 +01:00
mmzone.h
module.h MIPS: Netlogic: Cache, TLB support and feature overrides for XLR 2011-05-19 09:55:40 +01:00
msc01_ic.h
msgbuf.h
mutex.h
nile4.h
paccess.h Fix common misspellings 2011-03-31 11:26:23 -03:00
page.h MIPS: Document why RELOC_HIDE is there. 2010-10-04 18:33:55 +01:00
param.h
parport.h
pci.h
percpu.h
perf_event.h MIPS, Perf-events: Work with irq_work 2011-03-14 21:07:26 +01:00
pgalloc.h
pgtable-32.h mm: remove pte_*map_nested() 2010-10-26 16:52:08 -07:00
pgtable-64.h MIPS: Make TASK_SIZE reflect proper size for both 32 and 64 bit processes. 2010-10-29 19:08:53 +01:00
pgtable-bits.h
pgtable.h MIPS: topdown mmap support 2011-07-25 17:26:51 +01:00
pmon.h
poll.h
posix_types.h
prefetch.h
processor.h Fix common misspellings 2011-03-31 11:26:23 -03:00
prom.h MIPS: SNI: Fix conflicting wrapper symbols for headers. 2011-10-20 15:00:18 +01:00
ptrace.h Audit: push audit success and retcode into arch ptrace.h 2012-01-17 16:16:56 -05:00
r4k-timer.h
r4kcache.h update David Miller's old email address 2011-04-06 06:19:38 -07:00
reboot.h
reg.h
regdef.h MIPS: O32: Provide definition of registers ta0 .. ta3. 2011-10-24 23:34:27 +01:00
resource.h
rm9k-ocd.h
rtlx.h
scatterlist.h
seccomp.h
sections.h
segment.h
sembuf.h
serial.h
setup.h
sgialib.h update David Miller's old email address 2011-04-06 06:19:38 -07:00
sgiarcs.h update David Miller's old email address 2011-04-06 06:19:38 -07:00
sgidefs.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h Fix common misspellings 2011-03-31 11:26:23 -03:00
signal.h
sim.h
smp-ops.h MIPS: ARC: Fix build of firmware library on uniprocessor. 2011-07-20 23:12:11 +01:00
smp.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smtc.h MIPS: SMTC: Fix build. 2011-07-20 23:12:10 +01:00
smtc_ipi.h
smtc_proc.h
smvp.h
sni.h
socket.h net: add wireless TX status socket option 2011-11-09 16:01:02 -05:00
sockios.h
sparsemem.h
spinlock.h MIPS: Microoptimize arch_{read,write}_lock 2011-03-25 18:45:13 +01:00
spinlock_types.h
spram.h
stackframe.h MIPS: Don't clobber CP0_STATUS value for CONFIG_MIPS_MT_SMTC 2011-09-21 17:54:02 +02:00
stacktrace.h MIPS: Add new unwind_stack variant 2011-06-15 14:35:33 +02:00
stat.h
statfs.h
string.h
suspend.h PM / Hibernate: Remove arch_prepare_suspend() 2011-05-24 23:35:55 +02:00
swab.h
sysmips.h
system.h MIPS: Get rid of branches to .subsections. 2010-10-29 19:08:24 +01:00
termbits.h
termios.h
thread_info.h freezer: remove now unused TIF_FREEZE 2011-11-21 12:32:25 -08:00
time.h mips: convert to clocksource_register_hz/khz 2011-02-21 13:33:50 -08:00
timex.h
titan_dep.h
tlb.h
tlbdebug.h
tlbflush.h
topology.h
traps.h
txx9irq.h
txx9pio.h
txx9tmr.h
types.h consolidate umode_t declarations 2012-01-03 22:55:17 -05:00
uaccess.h MIPS: Make TASK_SIZE reflect proper size for both 32 and 64 bit processes. 2010-10-29 19:08:53 +01:00
uasm.h MIPS: Add uasm UASM_i_SRL_SAFE macro. 2011-07-26 06:47:36 +01:00
ucontext.h
unaligned.h
unistd.h MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
user.h
vdso.h
vga.h
vpe.h
war.h Fix common misspellings 2011-03-31 11:26:23 -03:00
watch.h
wbflush.h
xor.h