[Xen-devel] [PATCH]: Fix syscall return code when ptrace or audit is active

Chris Lalancette
Mon, 30 Jun 2008 14:08:58 -0000

Attached is a simple patch to fix the return value from the 64-bit kernel when
you call with a bad system call number with tracing enabled (for either ptrace
or audit).  What should happen is that the user process gets a -ENOSYS return
call from the syscall; what actually happens (only in the 64-bit kernel) is that
you get back the system call number.  The 32-bit kernel does not suffer from
this bug, and the pv-ops implementation in the upstream Linux kernel also does
not have this bug.  The attached patch makes the tracesys path look the same as
it does in upstream Linux, and ensures that we return -ENOSYS on this path.

Signed-off-by: Chris Lalancette <clalance@redhat.com>