Skip to content

Commit 4b0c0f2

Browse files
committed
tick: Cleanup NOHZ per cpu data on cpu down
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 <[email protected]> Cc: [email protected] Cc: Mike Galbraith <[email protected]> Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1305031451561.2886@ionos Signed-off-by: Thomas Gleixner <[email protected]>
1 parent fbd44a6 commit 4b0c0f2

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
@@ -904,7 +904,7 @@ void tick_cancel_sched_timer(int cpu)
904904
hrtimer_cancel(&ts->sched_timer);
905905
# endif
906906

907-
ts->nohz_mode = NOHZ_MODE_INACTIVE;
907+
memset(ts, 0, sizeof(*ts));
908908
}
909909
#endif
910910

0 commit comments

Comments
 (0)