Re: [PATCH 1/2] stop_machine: check work->done while handlingenqueued works

From: Tejun Heo
Date: Tue Feb 12 2013 - 12:37:46 EST


On Sun, Feb 10, 2013 at 01:22:43PM +0800, Hillf Danton wrote:
> In cpu_stopper_thread(), @work->done may be NULL if the cpu stop work
> is queued from stop_one_cpu_nowait(); however, cpu_stopper_thread()
> updates @done->ret without checking whether @done exists or not when
> the work function fails.
>
> While this can lead to oops, the only current user of
> stop_one_cpu_nowait() - active_load_balance_cpu_stop() - always
> returns 0 and thus there's no in-kernel user which triggers this bug.
>
> Fix it by checking whether @done exists before updating @done->ret.
>
> Thanks Tejun for sharing commit message.
>
> Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
> Reviewed-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Andrew, can you please take this?

Thanks.

--
tejun
--
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/