No description
  • C 98.2%
  • Assembly 1%
  • Makefile 0.3%
  • Shell 0.2%
  • Python 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Zhang Qiao d1f1de5dff cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug
commit 05c7b7a92cc87ff8d7fde189d0fade250697573c upstream.

As previously discussed(https://lkml.org/lkml/2022/1/20/51),
cpuset_attach() is affected with similar cpu hotplug race,
as follow scenario:

     cpuset_attach()				cpu hotplug
    ---------------------------            ----------------------
    down_write(cpuset_rwsem)
    guarantee_online_cpus() // (load cpus_attach)
					sched_cpu_deactivate
					  set_cpu_active()
					  // will change cpu_active_mask
    set_cpus_allowed_ptr(cpus_attach)
      __set_cpus_allowed_ptr_locked()
       // (if the intersection of cpus_attach and
         cpu_active_mask is empty, will return -EINVAL)
    up_write(cpuset_rwsem)

To avoid races such as described above, protect cpuset_attach() call
with cpu_hotplug_lock.

Fixes: be367d0992 ("cgroups: let ss->can_attach and ss->attach do whole threadgroups at a time")
Cc: stable@vger.kernel.org # v2.6.32+
Reported-by: Zhao Gongyi <zhaogongyi@huawei.com>
Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com>
Acked-by: Waiman Long <longman@redhat.com>
Reviewed-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-02 11:41:00 +01:00
arch arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610 2022-02-23 12:00:01 +01:00
block block/wbt: fix negative inflight counter when remove scsi device 2022-02-23 11:59:59 +01:00
certs
crypto
Documentation bpf: Add kconfig knob for disabling unpriv bpf by default 2022-02-16 12:52:49 +01:00
drivers net: macb: Align the dma and coherent dma masks 2022-02-23 12:00:01 +01:00
fs NFS: Do not report writeback errors in nfs_getattr() 2022-02-23 11:59:59 +01:00
include bonding: fix data-races around agg_select_timer 2022-02-23 11:59:58 +01:00
init bpf: Add kconfig knob for disabling unpriv bpf by default 2022-02-16 12:52:49 +01:00
ipc
kernel cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug 2022-03-02 11:41:00 +01:00
lib lib/iov_iter: initialize "flags" in new pipe_buffer 2022-02-23 11:59:59 +01:00
LICENSES
mm mm/kmemleak: avoid scanning potential huge holes 2022-02-08 18:24:28 +01:00
net netfilter: conntrack: don't refresh sctp entries in closed state 2022-02-23 12:00:00 +01:00
samples
scripts kconfig: fix failing to generate auto.conf 2022-02-23 12:00:01 +01:00
security ima: Do not print policy rule with inactive LSM labels 2022-02-16 12:52:47 +01:00
sound ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_range() 2022-02-23 11:59:58 +01:00
tools libsubcmd: Fix use-after-free for realloc(..., 0) 2022-02-23 11:59:58 +01:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.4.181 2022-02-23 12:00:01 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.