sched/fair: Use RCU accessors consistently for ->numa_group
authorJann Horn <jannh@google.com>
Tue, 16 Jul 2019 15:20:47 +0000 (17:20 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 25 Jul 2019 13:37:05 +0000 (15:37 +0200)
commitcb361d8cdef69990f6b4504dc1fd9a594d983c97
treecde527557b6259487a11df5f30a652ab965cda41
parent16d51a590a8ce3befb1308e0e7ab77f3b661af33
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.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Fixes: 8c8a743c5087 ("sched/numa: Use {cpu, pid} to create task groups for shared faults")
Link: https://lkml.kernel.org/r/20190716152047.14424-3-jannh@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/sched.h
kernel/sched/fair.c