]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched/vtime: Prevent unstable evaluation of WARN(vtime->state)
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Jan 2020 18:08:49 +0000 (19:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:11:52 +0000 (16:11 +0200)
commitb465366440eb3785e900fab9f840104ddfddd83c
treea86f64542c0cb0d9a1acee58874dd32ef9f9c17e
parentba4e1d03021d6a2e1c1cbf145200f6a92d6136f7
sched/vtime: Prevent unstable evaluation of WARN(vtime->state)

[ Upstream commit f1dfdab694eb3838ac26f4b73695929c07d92a33 ]

As the vtime is sampled under loose seqcount protection by kcpustat, the
vtime fields may change as the code flows. Where logic dictates a field
has a static value, use a READ_ONCE.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Fixes: 74722bb223d0 ("sched/vtime: Bring up complete kcpustat accessor")
Link: https://lkml.kernel.org/r/20200123180849.28486-1-frederic@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/cputime.c