]> git.baikalelectronics.ru Git - kernel.git/commit
m68k: Define asmlinkage_protect
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 23 Sep 2015 21:12:09 +0000 (23:12 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 28 Sep 2015 07:59:45 +0000 (09:59 +0200)
commit00e9ee1654a09b016076685106eb20461c255f8c
treef95d6e941e2f940e32cc711c2784062fb4cb5466
parentb5399c7b706e147fa706a1c55e35b5e9b5e56cce
m68k: Define asmlinkage_protect

Make sure the compiler does not modify arguments of syscall functions.
This can happen if the compiler generates a tailcall to another
function.  For example, without asmlinkage_protect sys_openat is compiled
into this function:

sys_openat:
clr.l %d0
move.w 18(%sp),%d0
move.l %d0,16(%sp)
jbra do_sys_open

Note how the fourth argument is modified in place, modifying the register
%d4 that gets restored from this stack slot when the function returns to
user-space.  The caller may expect the register to be unmodified across
system calls.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@vger.kernel.org
arch/m68k/include/asm/linkage.h