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>] [day] [month] [year] [list]
Message-Id: <20200824124939.486728-1-efremov@linux.com>
Date:   Mon, 24 Aug 2020 15:49:39 +0300
From:   Denis Efremov <efremov@...ux.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Denis Efremov <efremov@...ux.com>, Serge Hallyn <serge@...lyn.com>,
        James Morris <jmorris@...ei.org>,
        linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] security/commoncap: Use current_user_ns()

Modify cap_inh_is_capped(), cap_task_prctl() to use current_user_ns().

Signed-off-by: Denis Efremov <efremov@...ux.com>
---
 security/commoncap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index 59bf3c1674c8..82a61f77c07c 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -220,7 +220,7 @@ static inline int cap_inh_is_capped(void)
 	/* they are so limited unless the current task has the CAP_SETPCAP
 	 * capability
 	 */
-	if (cap_capable(current_cred(), current_cred()->user_ns,
+	if (cap_capable(current_cred(), current_user_ns(),
 			CAP_SETPCAP, CAP_OPT_NONE) == 0)
 		return 0;
 	return 1;
@@ -1206,7 +1206,7 @@ int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
 		    || ((old->securebits & SECURE_ALL_LOCKS & ~arg2))	/*[2]*/
 		    || (arg2 & ~(SECURE_ALL_LOCKS | SECURE_ALL_BITS))	/*[3]*/
 		    || (cap_capable(current_cred(),
-				    current_cred()->user_ns,
+				    current_user_ns(),
 				    CAP_SETPCAP,
 				    CAP_OPT_NONE) != 0)			/*[4]*/
 			/*
-- 
2.26.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ