Skip to content

Commit a51dce7

Browse files
committed
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 <brauner@kernel.org>
1 parent 2ec2aff commit a51dce7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/nstree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ static ssize_t do_listns_userns(struct klistns *kls)
584584

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

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

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

732732
nr_ns_ids--;

0 commit comments

Comments
 (0)