All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Waiman Long <longman@redhat.com>
Cc: "Zefan Li" <lizefan.x@bytedance.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Shuah Khan" <shuah@kernel.org>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, "Will Deacon" <will@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Juri Lelli" <juri.lelli@redhat.com>
Subject: Re: [PATCH v2 1/4] cgroup/cpuset: Fix partition root's cpuset.cpus update bug
Date: Wed, 29 Mar 2023 08:37:48 -1000	[thread overview]
Message-ID: <ZCSFfMeKRNERIBu6@slm.duckdns.org> (raw)
In-Reply-To: <20230317151508.1225282-2-longman@redhat.com>

On Fri, Mar 17, 2023 at 11:15:05AM -0400, Waiman Long wrote:
> It was found that commit 7a2127e66a00 ("cpuset: Call
> set_cpus_allowed_ptr() with appropriate mask for task") introduced a bug
> that corrupted "cpuset.cpus" of a partition root when it was updated.
> 
> It is because the tmp->new_cpus field of the passed tmp parameter
> of update_parent_subparts_cpumask() should not be used at all as
> it contains important cpumask data that should not be overwritten.
> Fix it by using tmp->addmask instead.
> 
> Also update update_cpumask() to make sure that trialcs->cpu_allowed
> will not be corrupted until it is no longer needed.
> 
> Fixes: 7a2127e66a00 ("cpuset: Call set_cpus_allowed_ptr() with appropriate mask for task")
> Signed-off-by: Waiman Long <longman@redhat.com>

Applied to cgroup/for-6.3-fixes w/ stable cc'd.

Thanks.

-- 
tejun

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "Zefan Li" <lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>,
	"Johannes Weiner"
	<hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	"Shuah Khan" <shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Will Deacon" <will-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Peter Zijlstra" <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	"Michal Koutný" <mkoutny-IBi9RG/b67k@public.gmane.org>,
	"Juri Lelli" <juri.lelli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v2 1/4] cgroup/cpuset: Fix partition root's cpuset.cpus update bug
Date: Wed, 29 Mar 2023 08:37:48 -1000	[thread overview]
Message-ID: <ZCSFfMeKRNERIBu6@slm.duckdns.org> (raw)
In-Reply-To: <20230317151508.1225282-2-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Fri, Mar 17, 2023 at 11:15:05AM -0400, Waiman Long wrote:
> It was found that commit 7a2127e66a00 ("cpuset: Call
> set_cpus_allowed_ptr() with appropriate mask for task") introduced a bug
> that corrupted "cpuset.cpus" of a partition root when it was updated.
> 
> It is because the tmp->new_cpus field of the passed tmp parameter
> of update_parent_subparts_cpumask() should not be used at all as
> it contains important cpumask data that should not be overwritten.
> Fix it by using tmp->addmask instead.
> 
> Also update update_cpumask() to make sure that trialcs->cpu_allowed
> will not be corrupted until it is no longer needed.
> 
> Fixes: 7a2127e66a00 ("cpuset: Call set_cpus_allowed_ptr() with appropriate mask for task")
> Signed-off-by: Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Applied to cgroup/for-6.3-fixes w/ stable cc'd.

Thanks.

-- 
tejun

  reply	other threads:[~2023-03-29 18:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 15:15 [PATCH v2 0/4] cgroup/cpuset: Miscellaneous updates Waiman Long
2023-03-17 15:15 ` Waiman Long
2023-03-17 15:15 ` [PATCH v2 1/4] cgroup/cpuset: Fix partition root's cpuset.cpus update bug Waiman Long
2023-03-29 18:37   ` Tejun Heo [this message]
2023-03-29 18:37     ` Tejun Heo
2023-03-17 15:15 ` [PATCH v2 2/4] cgroup/cpuset: Skip task update if hotplug doesn't affect current cpuset Waiman Long
2023-03-17 15:15   ` Waiman Long
2023-03-17 15:15 ` [PATCH v2 3/4] cgroup/cpuset: Include offline CPUs when tasks' cpumasks in top_cpuset are updated Waiman Long
2023-03-17 18:01   ` Michal Koutný
2023-03-17 18:01     ` Michal Koutný
2023-03-17 18:05     ` Waiman Long
2023-03-17 18:05       ` Waiman Long
2023-03-20 15:04       ` Michal Koutný
2023-03-20 15:04         ` Michal Koutný
2023-03-17 15:15 ` [PATCH v2 4/4] cgroup/cpuset: Minor updates to test_cpuset_prs.sh Waiman Long
2023-03-17 15:15   ` Waiman Long
2023-03-29 18:43   ` Tejun Heo
2023-03-28 13:40 ` [PATCH v2 0/4] cgroup/cpuset: Miscellaneous updates Will Deacon
2023-03-28 13:40   ` Will Deacon
2023-03-29  1:15   ` Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZCSFfMeKRNERIBu6@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=longman@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=peterz@infradead.org \
    --cc=shuah@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.