]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cgroup/cpuset: Fix retval in update_cpumask()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Thu, 29 Feb 2024 10:11:14 +0000 (15:41 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:36 +0000 (15:11 +0200)
commit29727355ac80b6097408c6c45f7d42839f14ad87
tree92d10bf26661fb95c9319d1fef4c57c424bbdf5a
parentce64ba1f6ec3439e4b4d880b4db99673f4507228
cgroup/cpuset: Fix retval in update_cpumask()

commit 25125a4762835d62ba1e540c1351d447fc1f6c7c upstream.

The update_cpumask(), checks for newly requested cpumask by calling
validate_change(), which returns an error on passing an invalid set
of cpu(s). Independent of the error returned, update_cpumask() always
returns zero, suppressing the error and returning success to the user
on writing an invalid cpu range for a cpuset. Fix it by returning
retval instead, which is returned by validate_change().

Fixes: 99fe36ba6fc1 ("cgroup/cpuset: Improve temporary cpumasks handling")
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Cc: stable@vger.kernel.org # v6.6+
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/cgroup/cpuset.c