]> git.baikalelectronics.ru Git - kernel.git/commit
x86: auditsyscall: fix fastpath return value after reschedule
authorRoland McGrath <roland@redhat.com>
Thu, 22 Jul 2010 00:44:12 +0000 (17:44 -0700)
committerRoland McGrath <roland@redhat.com>
Thu, 22 Jul 2010 00:44:12 +0000 (17:44 -0700)
commit82d7e3d9f5539bfea72d49235636e9eb7526c12f
treec140d13aa39a871fbf5be81d476efb947b663d56
parentf6acde89f39b042f21b583870027834a2ce0ebb3
x86: auditsyscall: fix fastpath return value after reschedule

In the CONFIG_AUDITSYSCALL fast-path for x86 64-bit system calls,
we can pass a bad return value and/or error indication for the
system call to audit_syscall_exit().  This happens when
TIF_NEED_RESCHED was set as the system call returned, so we went
out to schedule() and came back to the exit-audit fast-path.  The
fix is to reload the user return value register from the pt_regs
before using it for audit_syscall_exit().

Both the 32-bit kernel's fast path and the 64-bit kernel's 32-bit
system call fast paths work slightly differently, so that they
always leave the fast path entirely to reschedule and don't return
there, so they don't have the analogous bugs.

Reported-by: Alexander Viro <aviro@redhat.com>
Signed-off-by: Roland McGrath <roland@redhat.com>
arch/x86/kernel/entry_64.S