Re: [RFC PATCH v3 bpf-next 1/5] sched: fix stale get_pref_llc() stub for !CONFIG_SCHED_CACHE

From: Tim Chen

Date: Wed Oct 21 2026 - 16:40:40 EST


On Mon, 2026-10-19 at 14:41 +0800, Yafang Shao wrote:
> Commit b636fef85bda ("sched/cache: Introduce task_struct->sched_cache_grp
> to fix UAF") switched get_pref_llc() from taking a struct mm_struct * to
> taking the task's struct sched_cache_group *, but only updated the
> CONFIG_SCHED_CACHE definition and its caller: the stub in the
> !CONFIG_SCHED_CACHE branch kept the old mm_struct parameter.
>
> Fixes: b636fef85bda ("sched/cache: Introduce task_struct->sched_cache_grp to fix UAF")

Cc: <stable@xxxxxxxxxxxxxxx> #v7.2.x

> Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>
> Cc: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
> Cc: Chen Yu <yu.c.chen@xxxxxxxxx>
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 57360f5cdde4..973647ad6c2d 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -2194,7 +2194,7 @@ void init_sched_mm(struct task_struct *p) { }
> static void task_tick_cache(struct rq *rq, struct task_struct *p) { }
>
> static inline int get_pref_llc(struct task_struct *p,
> - struct mm_struct *mm)
> + struct sched_cache_group *grp)
> {
> return -1;
> }

Thanks for catching it.

Should be backported to 7.2.x kernel as commit b636fef85bda
that this patch fixes has been backported to stable.

Reviewed-by: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>

Tim