We didn't check if tsk->mm is available when an CPU goes down - and
of course - that is exactly when there is no task.
As such we would crash.
OraBug:
27678629
Reveiwed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
if (likely(prev != next)) {
/* Null tsk means switching to kernel, so that's safe */
- if (ibpb_inuse && tsk &&
+ if (ibpb_inuse && tsk && tsk->mm &&
get_dumpable(tsk->mm) != SUID_DUMP_USER)
native_wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB);