lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251109-namespace-6-19-fixes-v1-4-ae8a4ad5a3b3@kernel.org>
Date: Sun, 09 Nov 2025 22:11:25 +0100
From: Christian Brauner <brauner@...nel.org>
To: linux-fsdevel@...r.kernel.org, Josef Bacik <josef@...icpanda.com>, 
 Jeff Layton <jlayton@...nel.org>
Cc: Jann Horn <jannh@...gle.com>, Mike Yuan <me@...dnzj.com>, 
 Zbigniew Jędrzejewski-Szmek <zbyszek@...waw.pl>, 
 Lennart Poettering <mzxreary@...inter.de>, 
 Daan De Meyer <daan.j.demeyer@...il.com>, Aleksa Sarai <cyphar@...har.com>, 
 Amir Goldstein <amir73il@...il.com>, Tejun Heo <tj@...nel.org>, 
 Johannes Weiner <hannes@...xchg.org>, Thomas Gleixner <tglx@...utronix.de>, 
 Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>, 
 linux-kernel@...r.kernel.org, cgroups@...r.kernel.org, bpf@...r.kernel.org, 
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 
 netdev@...r.kernel.org, Arnd Bergmann <arnd@...db.de>, 
 Christian Brauner <brauner@...nel.org>
Subject: [PATCH 4/8] ns: return EFAULT on put_user() error

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

Signed-off-by: Christian Brauner <brauner@...nel.org>
---
 kernel/nstree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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--;

-- 
2.47.3


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ