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: <20250530200305.85319-4-jsavitz@redhat.com>
Date: Fri, 30 May 2025 16:03:05 -0400
From: Joel Savitz <jsavitz@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Joel Savitz <jsavitz@...hat.com>,
	Christian Brauner <brauner@...nel.org>,
	Al Viro <viro@...iv.linux.org.uk>
Subject: [PATCH 2/3] kernel/nsproxy: fix put_*() call ordering in validate_nsset()

The calls to get_nsproxy(), get_pid_ns(), and get_user_ns() happen in
that order, so call their respective put_*() functions in the reverse
order.

Signed-off-by: Joel Savitz <jsavitz@...hat.com>
---
 kernel/nsproxy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index be89e006e6aa..20b07120dbfd 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -481,10 +481,10 @@ static int validate_nsset(struct nsset *nsset, struct pid *pid)
 #endif
 
 out:
+	put_user_ns(user_ns);
 	put_pid_ns(pid_ns);
 	if (nsp)
 		put_nsproxy(nsp);
-	put_user_ns(user_ns);
 
 	return ret;
 }
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ