FAILED: patch "[PATCH] sched/fair: Use RCU accessors consistently for ->numa_group" failed to apply to 4.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From cb361d8cdef69990f6b4504dc1fd9a594d983c97 Mon Sep 17 00:00:00 2001
From: Jann Horn <[email protected]>
Date: Tue, 16 Jul 2019 17:20:47 +0200
Subject: [PATCH] sched/fair: Use RCU accessors consistently for ->numa_group
The old code used RCU annotations and accessors inconsistently for ->numa_group, which can lead to use-after-frees and NULL dereferences.
Let all accesses to ->numa_group use proper RCU helpers to prevent such issues.
include/linux/sched.h +9 -1
@@ -1092,7 +1092,15 @@ struct task_struct {u64 last_sum_exec_runtime;struct callback_head numa_work; -struct numa_group *numa_group; +/* +* This pointer is only modified for current in syscall and +* pagefault context (and for tasks being destroyed), so it can be read +* from any of the following contexts: +* - RCU read-side critical section +* - current->numa_group from everywhere +* - task's runqueue locked, task not running +*/ +struct numa_group __rcu *numa_group;/* * numa_faults is an array split into four regions:
kernel/sched/fair.c +81 -39
308 lines not on this page · raw message