aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
authorWaiman Long <[email protected]>2022-12-31 04:11:20 +0000
committerIngo Molnar <[email protected]>2023-01-09 10:43:23 +0000
commit9a5418bc48babb313d2a62df29ebe21ce8c06c59 (patch)
tree98446ca9be18345ffe01388cd7c5e983abe35aed /drivers/net/xen-netfront.c
parentsched/core: Fix use-after-free bug in dup_user_cpus_ptr() (diff)
downloadkernel-9a5418bc48babb313d2a62df29ebe21ce8c06c59.tar.gz
kernel-9a5418bc48babb313d2a62df29ebe21ce8c06c59.zip
sched/core: Use kfree_rcu() in do_set_cpus_allowed()
Commit 851a723e45d1 ("sched: Always clear user_cpus_ptr in do_set_cpus_allowed()") may call kfree() if user_cpus_ptr was previously set. Unfortunately, some of the callers of do_set_cpus_allowed() may have pi_lock held when calling it. So the following splats may be printed especially when running with a PREEMPT_RT kernel: WARNING: possible circular locking dependency detected BUG: sleeping function called from invalid context To avoid these problems, kfree_rcu() is used instead. An internal cpumask_rcuhead union is created for the sole purpose of facilitating the use of kfree_rcu() to free the cpumask. Since user_cpus_ptr is not being used in non-SMP configs, the newly introduced alloc_user_cpus_ptr() helper will return NULL in this case and sched_setaffinity() is modified to handle this special case. Fixes: 851a723e45d1 ("sched: Always clear user_cpus_ptr in do_set_cpus_allowed()") Suggested-by: Peter Zijlstra <[email protected]> Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/net/xen-netfront.c')
0 files changed, 0 insertions, 0 deletions