[PATCH 2/2] asmlinkage_protect sys_io_getevents

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>
Cc: Jakub Jelinek <jakub@...>, Dave Jones <davej@...>, <drepper@...>, <mingo@...>, <tglx@...>, <linux-kernel@...>
Date: Thursday, April 10, 2008 - 6:38 pm

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>
---
 fs/aio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 6af9219..60a4cd4 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -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;
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/2] asmlinkage_protect sys_io_getevents, Roland McGrath, (Thu Apr 10, 6:38 pm)