Commit 9cef6f8c authored by Kamalesh Babulal's avatar Kamalesh Babulal Committed by Chen Ridong
Browse files

cgroup/cpuset: Fix retval in update_cpumask()

mainline inclusion
from mainline-v6.8-rc1
commit 25125a4762835d62ba1e540c1351d447fc1f6c7c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I93ZFV
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=25125a4762835d62ba1e540c1351d447fc1f6c7c



----------------------------------------------------------------------

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: 99fe36ba ("cgroup/cpuset: Improve temporary cpumasks handling")
Signed-off-by: default avatarKamalesh Babulal <kamalesh.babulal@oracle.com>
Reviewed-by: default avatarWaiman Long <longman@redhat.com>
Cc: stable@vger.kernel.org # v6.6+
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
parent 61f5006b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2573,7 +2573,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
		update_partition_sd_lb(cs, old_prs);
out_free:
	free_cpumasks(NULL, &tmp);
	return 0;
	return retval;
}

/**