From: Christian Brauner Date: Sun, 9 Nov 2025 21:11:25 +0000 (+0100) Subject: ns: return EFAULT on put_user() error X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a51dce7c3261d26e574b35da71dac3903bb35ae2;p=thirdparty%2Flinux.git 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: Christian Brauner --- diff --git a/kernel/nstree.c b/kernel/nstree.c index 55b72d4f8de4..f27f772a6762 100644 --- a/kernel/nstree.c +++ b/kernel/nstree.c @@ -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--;