linux/arch/s390
Al Viro 8f2961c39e [S390] audit: get s390 ret_from_fork in sync with other architectures
On s390 we have ret_from_fork jump not to the "do all work we
normally do on return from syscall" as on x86, ppc, etc., but to the
"do all such work except audit".  Historical reasons - the codepath
triggered when we have AUDIT process flag set is separated from the
normall one and they converge at sysc_return, which is the common
part of post-syscall work.  And does not include calling audit_syscall_exit() -
that's done in the end of sysc_tracesys path, just before that path jumps
to sysc_return.

	IOW, the child returning from fork()/clone()/vfork() doesn't
call audit_syscall_exit() at all, so no matter what we do with its
audit context, we are not going to see the audit entry.

	The fix is simple: have ret_from_fork go to the point just past
the call of sys_.... in the 'we have AUDIT flag set' path.  There we
have (64bit variant; for 31bit the situation is the same):
sysc_tracenogo:
        tm      __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
        jz      sysc_return
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
        larl    %r14,sysc_return        # return point is sysc_return
        jg      do_syscall_trace_exit
which is precisely what we need - check the flag, bugger off to sysc_return
if not set, otherwise call do_syscall_trace_exit() and bugger off to
sysc_return.  r9 has just been properly set by ret_from_fork itself,
so we are fine.

	Tested on s390x, seems to work fine.  WARNING: it's been about
16 years since my last contact with 3X0 assembler[1], so additional
review would be very welcome.  I don't think I've managed to screw it
up, but...

[1] that *was* in another country and besides, the box is dead...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:38:07 +01:00
..
appldata [S390] appldata: unsigned ops->size cannot be negative 2008-10-28 11:12:04 +01:00
boot
crypto Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6 2008-07-14 14:48:31 -07:00
hypfs vfs: Use const for kernel parser table 2008-10-13 10:10:37 -07:00
include/asm Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-11-30 11:07:16 -08:00
kernel [S390] audit: get s390 ret_from_fork in sync with other architectures 2008-12-25 13:38:07 +01:00
kvm KVM: s390: Fix problem state handling in guest sigp handler 2008-11-23 14:34:39 +02:00
lib [S390] Move private simple udelay function to arch/s390/lib/delay.c. 2008-10-10 21:33:58 +02:00
math-emu [S390] remove -traditional 2008-04-30 13:38:44 +02:00
mm [S390] pgtables: Fix race in enable_sie vs. page table ops 2008-10-28 11:12:03 +01:00
oprofile Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
defconfig [S390] Update default configuration. 2008-11-27 11:06:58 +01:00
Kconfig [S390] No more 4kb stacks. 2008-10-28 11:12:06 +01:00
Kconfig.debug [S390] DEBUG_PAGEALLOC support for s390. 2008-02-05 16:50:54 +01:00
Makefile KVM: s390: arch backend for the kvm kernel module 2008-04-27 12:00:42 +03:00