Re: [PATCH] sched/core: Fix a TOCTOU bug in sched_non_preferred_cpu_push_stop()

From: Fushuai Wang

Date: Mon Nov 16 2026 - 23:31:22 EST


> I think the biggest difference of sched_push_current_non_preferred_cpu() and
> balance_push() is that sched_push_current_non_preferred_cpu() runs in irq context
> while balance_push() runs in task context.
>
> So, a balance_push() path be like:
> task context:
> migrate_disable()
> preempt_disable()
> migration_disabled = 1
> preempt_enable()
> is_migration_disabled()
>
> While a sched_push_current_non_preferred_cpu() path be like:
> task context: irq context:
> migrate_disable()
> preempt_disable()
> is_migration_disabled()
> migration_disabled = 1
> preempt_enable()
> So I think a recheck is necessary.

Ping.

Regards,
Fushuai.