login
Header Space

 
 

[PATCH] waitid si_code regression

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>, Linus Torvalds <torvalds@...>
Cc: Oleg Nesterov <oleg@...>, <linux-kernel@...>
Date: Saturday, March 8, 2008 - 3:41 pm

In commit ee7c82da830ea860b1f9274f1f0cdf99f206e7c2, the magic (short)
cast when storing si_code was lost in wait_task_stopped.  This leaks
the in-kernel CLD_* values that do not match what userland expects.

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
---
 kernel/exit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index cd20bf0..53872bf 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1378,7 +1378,7 @@ unlock_sig:
 	if (!retval && infop)
 		retval = put_user(0, &infop->si_errno);
 	if (!retval && infop)
-		retval = put_user(why, &infop->si_code);
+		retval = put_user((short)why, &infop->si_code);
 	if (!retval && infop)
 		retval = put_user(exit_code, &infop->si_status);
 	if (!retval && infop)
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] waitid si_code regression, Roland McGrath, (Sat Mar 8, 3:41 pm)
Re: [PATCH] waitid si_code regression, Oleg Nesterov, (Sat Mar 8, 4:19 pm)
speck-geostationary