linux-stable/tools
Waiman Long a2ab7f2cf5 cgroup/cpuset: Fix wrong check in update_parent_subparts_cpumask()
commit e5ae880384 upstream.

It was found that the check to see if a partition could use up all
the cpus from the parent cpuset in update_parent_subparts_cpumask()
was incorrect. As a result, it is possible to leave parent with no
effective cpu left even if there are tasks in the parent cpuset. This
can lead to system panic as reported in [1].

Fix this probem by updating the check to fail the enabling the partition
if parent's effective_cpus is a subset of the child's cpus_allowed.

Also record the error code when an error happens in update_prstate()
and add a test case where parent partition and child have the same cpu
list and parent has task. Enabling partition in the child will fail in
this case.

[1] https://www.spinics.net/lists/cgroups/msg36254.html

Fixes: f0af1bfc27 ("cgroup/cpuset: Relax constraints to partition & cpus changes")
Cc: stable@vger.kernel.org # v6.1
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@intel.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-09 11:28:15 +01:00
..
accounting
arch parisc: Align parisc MADV_XXX constants with all other architectures 2023-01-14 10:33:40 +01:00
bootconfig
bpf bpftool: Fix memory leak in do_build_table_cb 2022-12-31 13:32:23 +01:00
build perf bpf: Fix build with libbpf 0.7.0 by checking if bpf_program__set_insns() is available 2022-10-25 17:40:48 -03:00
certs
cgroup iocost_monitor: reorder BlkgIterator 2022-09-23 16:57:10 -10:00
counter
debugging
edid
firewire
firmware
gpio tools: gpio: fix -c option of gpio-event-mon 2023-02-01 08:34:49 +01:00
hv
iio tools: iio: iio_generic_buffer: Fix read size 2022-11-01 08:48:13 +00:00
include tools/nolibc: prevent gcc from making memset() loop over itself 2023-02-01 08:34:31 +01:00
io_uring
kvm/kvm_stat tools/kvm_stat: update exit reasons for vmx/svm/aarch64/userspace 2022-11-09 12:26:52 -05:00
laptop
leds
lib libbpf: Avoid enum forward-declarations in public API in C++ mode 2022-12-31 13:33:03 +01:00
memory-model
objtool objtool: Fix SEGFAULT 2023-01-04 11:28:57 +01:00
pci
pcmcia
perf perf kmem: Support field "node" in evsel__process_alloc_event() coping with recent tracepoint restructuring 2023-01-18 11:58:31 +01:00
power pm-graph v5.10 2022-10-25 17:46:15 +02:00
rcu
scripts
spi
testing cgroup/cpuset: Fix wrong check in update_parent_subparts_cpumask() 2023-02-09 11:28:15 +01:00
thermal
time
tracing
usb
verification rv/dot2c: Make automaton definition static 2022-10-20 16:02:45 -04:00
virtio tools/virtio: initialize spinlocks in vring_test.c 2023-01-24 07:24:30 +01:00
vm tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" 2022-11-30 14:49:41 -08:00
wmi
Makefile