Re: [PATCH] wait_task_stopped: pass correct exit_code to wait_noreap_copyout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 18 Nov 2007 09:13:24 +0000 Scott James Remnant <[email protected]> wrote:

> In wait_task_stopped() exit_code already contains the right value for
> the si_status member of siginfo, and this is simply set in the non
> WNOWAIT case.
>     
> Pass it unchanged to wait_noreap_copyout();  we would only need to
> shift it and add 0x7f if we were returning it in the user status field
> and that isn't used for any function that permits WNOWAIT.
>     
> Signed-off-by: Scott James Remnant <[email protected]>
> Signed-off-by: Oleg Nesterov <[email protected]>
> Signed-off-by: Roland McGrath <[email protected]>
> 
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -1389,7 +1389,7 @@ static int wait_task_stopped(struct task_struct
> *p, int delayed_group_leader,
>  		if (unlikely(!exit_code) || unlikely(p->exit_state))
>  			goto bail_ref;
>  		return wait_noreap_copyout(p, pid, uid,
> -					   why, (exit_code << 8) | 0x7f,
> +					   why, exit_code,
>  					   infop, ru);
>  	}

Is this bug visible to userspace?  If so, I'm surprised that none of the
various testsuites (which like to exercise this sort of interface) has
detected it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux