]> git.baikalelectronics.ru Git - kernel.git/commit
x86-64, compat: Test %rax for the syscall number, not %eax
authorH. Peter Anvin <hpa@linux.intel.com>
Tue, 14 Sep 2010 19:42:41 +0000 (12:42 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Tue, 14 Sep 2010 23:08:46 +0000 (16:08 -0700)
commit40599f1e4f1e6d872a06ff93f1823a4dedc2485a
tree98e061ce49af5ce48d6d67ffe5d3258563f4445d
parentac43ba63566641b52e621d8e4173e55026b61885
x86-64, compat: Test %rax for the syscall number, not %eax

On 64 bits, we always, by necessity, jump through the system call
table via %rax.  For 32-bit system calls, in theory the system call
number is stored in %eax, and the code was testing %eax for a valid
system call number.  At one point we loaded the stored value back from
the stack to enforce zero-extension, but that was removed in checkin
f00e1f704f98ef2992aa11e8b2eb71fe8ae79176.  An actual 32-bit process
will not be able to introduce a non-zero-extended number, but it can
happen via ptrace.

Instead of re-introducing the zero-extension, test what we are
actually going to use, i.e. %rax.  This only adds a handful of REX
prefixes to the code.

Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: <stable@kernel.org>
Cc: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
arch/x86/ia32/ia32entry.S