Re: [PATCH 5/5] Use copy_wait_opts_to_user() inwait_task_continued()

From: Oleg Nesterov
Date: Mon Jun 15 2009 - 13:00:29 EST


On 05/11, Vitaly Mayatskikh wrote:
>
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -1416,19 +1416,16 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p)
> get_task_struct(p);
> read_unlock(&tasklist_lock);
>
> - if (!wo->wo_info) {
> - retval = wo->wo_rusage
> - ? getrusage(p, RUSAGE_BOTH, wo->wo_rusage) : 0;
> - put_task_struct(p);
> - if (!retval && wo->wo_stat)
> - retval = put_user(0xffff, wo->wo_stat);
> - if (!retval)
> - retval = pid;
> - } else {
> - retval = wait_noreap_copyout(wo, p, pid, uid,
> - CLD_CONTINUED, SIGCONT);
> - BUG_ON(retval == 0);
> - }
> + retval = copy_wait_opts_to_user(wo, p, pid, uid,
> + CLD_CONTINUED, SIGCONT, SIGCHLD);
> + put_task_struct(p);
> +
> + if (!retval && wo->wo_stat)
> + retval = put_user(0xffff, wo->wo_stat);

This adds another user-visible change. Before the patch, we ignore
->wo_stat if ->wo_info != NULL.

This change looks like the fix to me, but again, this should be
documented/discussed.


I could send the fixes for 3 and 4, but unfortunately Vitaly has
the vacation now. I think it is better to drop

wait_task_-cleanups-split-wait_noreap_copyout.patch
wait_task_-cleanups-use-copy_wait_opts_to_user-in-wait_task_stopped.patch
wait_task_-cleanups-use-copy_wait_opts_to_user-in-do_wait.patch
wait_task_-cleanups-use-copy_wait_opts_to_user-in-wait_task_zombie.patch
wait_task_-cleanups-use-copy_wait_opts_to_user-in-wait_task_continued.patch

patches, and wait for Vitaly to redo/resend.

Oleg.

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