[tip: sched/urgent] sched: fix stale get_pref_llc() stub for !CONFIG_SCHED_CACHE

From: tip-bot2 for Yafang Shao

Date: Sat Oct 24 2026 - 07:40:39 EST


The following commit has been merged into the sched/urgent branch of tip:

Commit-ID: cac037a85c1971ec75c4d3edf5a28af9ec2a089c
Gitweb: https://git.kernel.org/tip/cac037a85c1971ec75c4d3edf5a28af9ec2a089c
Author: Yafang Shao <laoar.shao@xxxxxxxxx>
AuthorDate: Fri, 23 Oct 2026 10:31:04 +08:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Fri, 23 Oct 2026 19:09:54 +02:00

sched: fix stale get_pref_llc() stub for !CONFIG_SCHED_CACHE

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")
Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Reviewed-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
Reviewed-by: Chen Yu <yu.c.chen@xxxxxxxxx>
Reviewed-by: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> #v7.2.x
Link: https://patch.msgid.link/20261023023105.28829-2-laoar.shao@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 d750f2f..6057bb5 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;
}