* [PATCH] waitid si_code regression
@ 2008-03-08 19:41 Roland McGrath
2008-03-08 20:19 ` Oleg Nesterov
0 siblings, 1 reply; 2+ messages in thread
From: Roland McGrath @ 2008-03-08 19:41 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: Oleg Nesterov, linux-kernel
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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] waitid si_code regression
2008-03-08 19:41 [PATCH] waitid si_code regression Roland McGrath
@ 2008-03-08 20:19 ` Oleg Nesterov
0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2008-03-08 20:19 UTC (permalink / raw)
To: Roland McGrath; +Cc: Andrew Morton, Linus Torvalds, linux-kernel
On 03/08, Roland McGrath wrote:
>
> 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.
>
> 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);
Ugh, thanks.
Oleg.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-08 20:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-08 19:41 [PATCH] waitid si_code regression Roland McGrath
2008-03-08 20:19 ` Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox