Skip to content

Commit 2d72fdf

Browse files
KAGA-KOKOAirOne70
authored andcommitted
tick: Cleanup NOHZ per cpu data on cpu down
commit 4b0c0f2 upstream. Prarit reported a crash on CPU offline/online. The reason is that on CPU down the NOHZ related per cpu data of the dead cpu is not cleaned up. If at cpu online an interrupt happens before the per cpu tick device is registered the irq_enter() check potentially sees stale data and dereferences a NULL pointer. Cleanup the data after the cpu is dead. Reported-by: Prarit Bhargava <prarit@redhat.com> Cc: Mike Galbraith <bitbucket@online.de> Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1305031451561.2886@ionos Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ef6a42b commit 2d72fdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/tick-sched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ void tick_cancel_sched_timer(int cpu)
879879
hrtimer_cancel(&ts->sched_timer);
880880
# endif
881881

882-
ts->nohz_mode = NOHZ_MODE_INACTIVE;
882+
memset(ts, 0, sizeof(*ts));
883883
}
884884
#endif
885885

0 commit comments

Comments
 (0)