Re: [PATCH] sched/cache: Fix use-after-free of the mm replaced by exec

From: Chen Yu

Date: Mon Aug 31 2026 - 23:02:15 EST


On Mon, Aug 31, 2026 at 03:10:40PM -0700, Tim Chen wrote:


[ ... ]

> > > We should probably prioritize to merge the first couple of patches from
> > > that series now in light of this issue. It will make maintenance and future
> > > modification of the cache aware scheduling code easier.
> >
> > That is a fairly large change.
>
> However adding rcu synchronization will slow down the launch of a new process
> too much. The rq lock solution has less latency in my opinion. But I
> think decoupling sc_stat is the best solution without adding latency in the
> exec path.
>

OK, I see. In decoupling patches 1 and 2, the lifetime of the sched_group is managed via
a reference count, and it is freed using the non-blocking call_rcu() instead of
synchronize_rcu().

thanks,
Chenyu