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: <43ad0d6c52a7aff7f063347d09efc8c68f4c50a8.1444302968.git.sergei@s15v.net>
Date:	Thu,  8 Oct 2015 14:31:37 +0300
From:	Sergei Zviagintsev <sergei@...v.net>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Daniel Mack <daniel@...que.org>,
	David Herrmann <dh.herrmann@...glemail.com>,
	Djalal Harouni <tixxdz@...ndz.org>
Cc:	linux-kernel@...r.kernel.org, Sergei Zviagintsev <sergei@...v.net>
Subject: [PATCH 08/44] kdbus: Rename var in kdbus_meta_export_caps()

Rename `parent' to `member'. We currently set `parent' to true during
iteration over namespaces if `cred' resides in one of parent namespaces
of `user_ns'. But if `cred' is a member of `user_ns' itself, `parent'
name is not the best choice. Also new `member' name is more consistent
with the `owner' var, as it can be read "cred is a member of user_ns or
one of its parents" and "cred is the owner of ...".

Signed-off-by: Sergei Zviagintsev <sergei@...v.net>
---
 ipc/kdbus/metadata.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ipc/kdbus/metadata.c b/ipc/kdbus/metadata.c
index 4ff4b99a40e0..788b4d9c7ecb 100644
--- a/ipc/kdbus/metadata.c
+++ b/ipc/kdbus/metadata.c
@@ -725,7 +725,7 @@ static void kdbus_meta_export_caps(struct kdbus_meta_caps *out,
 {
 	struct user_namespace *iter;
 	const struct cred *cred = mp->cred;
-	bool parent = false, owner = false;
+	bool member = false, owner = false;
 	int i;
 
 	/*
@@ -748,7 +748,7 @@ static void kdbus_meta_export_caps(struct kdbus_meta_caps *out,
 	 */
 	for (iter = user_ns; iter; iter = iter->parent) {
 		if (iter == cred->user_ns) {
-			parent = true;
+			member = true;
 			break;
 		}
 
@@ -765,7 +765,7 @@ static void kdbus_meta_export_caps(struct kdbus_meta_caps *out,
 	out->last_cap = CAP_LAST_CAP;
 
 	CAP_FOR_EACH_U32(i) {
-		if (parent) {
+		if (member) {
 			out->set[0].caps[i] = cred->cap_inheritable.cap[i];
 			out->set[1].caps[i] = cred->cap_permitted.cap[i];
 			out->set[2].caps[i] = cred->cap_effective.cap[i];
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ