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: <0a74eb1422ebde6f1df76585451d7839d4d96e23.1444302968.git.sergei@s15v.net>
Date:	Thu,  8 Oct 2015 14:31:44 +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 15/44] kdbus: Simplify bitwise expression in kdbus_meta_get_mask()

Replace the expression with more concise and readable equivalent. It can
be proven by opening parentheses:

    r & ~((p | i) & r) == r & (~(p | i) | ~r) ==
        (r & ~(p | i)) | (r & ~r) == r & ~(p | i) == r & ~p & ~i

Signed-off-by: Sergei Zviagintsev <sergei@...v.net>
---
 ipc/kdbus/metadata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/kdbus/metadata.c b/ipc/kdbus/metadata.c
index 788b4d9c7ecb..61215a078359 100644
--- a/ipc/kdbus/metadata.c
+++ b/ipc/kdbus/metadata.c
@@ -1321,7 +1321,7 @@ static u64 kdbus_meta_get_mask(struct pid *prv_pid, u64 prv_mask,
 	 * the sender, but still requested by the receiver. If any are left,
 	 * perform rather expensive /proc access checks for them.
 	 */
-	missing = req_mask & ~((prv_mask | impl_mask) & req_mask);
+	missing = req_mask & ~prv_mask & ~impl_mask;
 	if (missing)
 		proc_mask = kdbus_meta_proc_mask(prv_pid, req_pid, req_cred,
 						 missing);
-- 
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