Skip to content

Commit

Permalink
tick: Cleanup NOHZ per cpu data on cpu down
Browse files Browse the repository at this point in the history
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 <[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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
KAGA-KOKO authored and AirOne70 committed Oct 2, 2017
1 parent ef6a42b commit 2d72fdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ void tick_cancel_sched_timer(int cpu)
hrtimer_cancel(&ts->sched_timer);
# endif

ts->nohz_mode = NOHZ_MODE_INACTIVE;
memset(ts, 0, sizeof(*ts));
}
#endif

Expand Down

0 comments on commit 2d72fdf

Please sign in to comment.