Skip to content

Commit

Permalink
asmlinkage_protect sys_io_getevents
Browse files Browse the repository at this point in the history
Use asmlinkage_protect in sys_io_getevents, because GCC for i386 with
CONFIG_FRAME_POINTER=n can decide to clobber an argument word on the
stack, i.e. the user struct pt_regs.  Here the problem is not a tail
call, but just the compiler's use of the stack when it inlines and
optimizes the body of the called function.  This seems to avoid it.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roland McGrath authored and torvalds committed Apr 11, 2008
1 parent 54a0151 commit 598af05
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/aio.c
Expand Up @@ -1790,6 +1790,7 @@ asmlinkage long sys_io_getevents(aio_context_t ctx_id,
put_ioctx(ioctx);
}

asmlinkage_protect(5, ret, ctx_id, min_nr, nr, events, timeout);
return ret;
}

Expand Down

0 comments on commit 598af05

Please sign in to comment.