In the Linux kernel, the following vulnerability has been resolved:
archtopology: Avoid use-after-free for scalefreq_data
Currently topologyscalefreqtick() (which gets called from schedulertick()) may end up using a pointer to "struct scalefreqdata", which was previously cleared by topologyclearscalefreqsource(), as there is no protection in place here. The users of topologyclearscalefreqsource() though needs a guarantee that the previously cleared scalefreqdata isn't used anymore, so they can free the related resources.
Since topologyscalefreq_tick() is called from scheduler tick, we don't want to add locking in there. Use the RCU update mechanism instead (which is already used by the scheduler's utilization update path) to guarantee race free updates here.
synchronizercu() makes sure that all RCU critical sections that started before it is called, will finish before it returns. And so the callers of topologyclearscalefreq_source() don't need to worry about their callback getting called anymore.