[PATCH v5 0/2] sched: Fix dup_user_cpus_ptr() & do_set_cpus_allowed() bugs

From: Waiman Long
Date: Fri Dec 30 2022 - 10:33:44 EST


v5:
- Add an alloc_user_cpus_ptr() helper and use it in patch 2.

v4:
- Make sure user_cpus_ptr allocation size is large enough for
rcu_head.

This series fixes a UAF bug in dup_user_cpus_ptr() and uses kfree_rcu()
in do_set_cpus_allowed to avoid lockdep splats.

Waiman Long (2):
sched: Fix use-after-free bug in dup_user_cpus_ptr()
sched: Use kfree_rcu() in do_set_cpus_allowed()

kernel/sched/core.c | 58 +++++++++++++++++++++++++++++++++++++++------
1 file changed, 51 insertions(+), 7 deletions(-)

--
2.31.1