Re: [PATCH] Syscall arguments are unsigned long (full registers)

From
Andi Kleen <hidden>
Date
2016-07-04 14:28:08
Also in
lkml
Reply to
Tautschnig, Michael, 2016-07-04
On Mon, Jul 04, 2016 at 01:52:58PM +0000, Tautschnig, Michael wrote:
All syscall arguments are passed in as types of the same byte size as
unsigned long (width of full registers). Using a smaller type without a
cast may result in losing bits of information. In all other instances
apart from the ones fixed by the patch the code explicitly introduces
type casts (using, e.g., SYSCALL_DEFINE1).

While goto-cc reported these problems at build time, it is noteworthy
that the calling conventions specified in the System V AMD64 ABI do
ensure that parameters 1-6 are passed via registers, thus there is no
implied risk of misaligned stack access.
Does this actually fix anything?

It seems a big dangerous to me, potentially breaking some existing
binaries that rely on these arguments being truncated.

-Andi
Thread (8 messages) 8 messages, 4 authors, last reply 2016-07-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help