Unverified Commit a51dce7c authored by Christian Brauner's avatar Christian Brauner
Browse files

ns: return EFAULT on put_user() error

Don't return EINVAL, return EFAULT just like we do in other system
calls.

Link: https://patch.msgid.link/20251109-namespace-6-19-fixes-v1-4-ae8a4ad5a3b3@kernel.org


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 2ec2aff3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ static ssize_t do_listns_userns(struct klistns *kls)

		if (put_user(valid->ns_id, ns_ids + ret)) {
			ns_put(prev);
			return -EINVAL;
			return -EFAULT;
		}

		nr_ns_ids--;
@@ -726,7 +726,7 @@ static ssize_t do_listns(struct klistns *kls)

		if (put_user(valid->ns_id, ns_ids + ret)) {
			ns_put(prev);
			return -EINVAL;
			return -EFAULT;
		}

		nr_ns_ids--;