]> git.baikalelectronics.ru Git - kernel.git/commit
include/linux/sched/mm.h: use rcu_dereference in in_vfork()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sat, 13 Mar 2021 05:08:03 +0000 (21:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Mar 2021 19:27:30 +0000 (11:27 -0800)
commitc6fad30b91c14f8f0784f8b4375dbe939e788d53
tree9c1436d6fd11b3ba6e8151c707f11b8c5cfe788e
parent34f8e34cf488b5c92cd2259fc65e97562a383db9
include/linux/sched/mm.h: use rcu_dereference in in_vfork()

Fix a sparse warning by using rcu_dereference().  Technically this is a
bug and a sufficiently aggressive compiler could reload the `real_parent'
pointer outside the protection of the rcu lock (and access freed memory),
but I think it's pretty unlikely to happen.

Link: https://lkml.kernel.org/r/20210221194207.1351703-1-willy@infradead.org
Fixes: 319ee6e24255 ("mm, oom: skip vforked tasks from being selected")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/sched/mm.h