[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBCi0gRGf2ronNyGDBeNsBJkEZ6aTe29gVnTUD2qh6Bnog@mail.gmail.com>
Date: Sun, 10 Feb 2013 13:22:43 +0800
From: Hillf Danton <dhillf@...il.com>
To: Tejun Heo <tj@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>,
Hillf Danton <dhillf@...il.com>
Subject: [PATCH 1/2] stop_machine: check work->done while handling enqueued works
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@...il.com>
Reviewed-by: Namhyung Kim <namhyung@...nel.org>
---
--- a/kernel/stop_machine.c Sun Feb 10 12:51:46 2013
+++ b/kernel/stop_machine.c Sun Feb 10 12:58:58 2013
@@ -279,7 +279,7 @@ repeat:
preempt_disable();
ret = fn(arg);
- if (ret)
+ if (ret && done)
done->ret = ret;
/* restore preemption and check it's still balanced */
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists