6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kamalesh Babulal <kamalesh.babulal@xxxxxxxxxx> 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@xxxxxxxxxx> Reviewed-by: Waiman Long <longman@xxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx # v6.6+ Signed-off-by: Tejun Heo <tj@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- kernel/cgroup/cpuset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1948,7 +1948,7 @@ static int update_cpumask(struct cpuset } out_free: free_cpumasks(NULL, &tmp); - return 0; + return retval; } /*