linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] apparmor: Fix logical error in verify_header()
@ 2017-07-08 19:50 Christos Gkekas
  2017-08-01  0:22 ` John Johansen
  0 siblings, 1 reply; 2+ messages in thread
From: Christos Gkekas @ 2017-07-08 19:50 UTC (permalink / raw)
  To: John Johansen, James Morris, Serge E. Hallyn,
	linux-security-module, linux-kernel
  Cc: Christos Gkekas

verify_header() is currently checking whether interface version is less
than 5 *and* greater than 7, which always evaluates to false. Instead it
should check whether it is less than 5 *or* greater than 7.

Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
---
 security/apparmor/policy_unpack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index c600f4d..f273c61 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -832,7 +832,7 @@ static int verify_header(struct aa_ext *e, int required, const char **ns)
 	 * if not specified use previous version
 	 * Mask off everything that is not kernel abi version
 	 */
-	if (VERSION_LT(e->version, v5) && VERSION_GT(e->version, v7)) {
+	if (VERSION_LT(e->version, v5) || VERSION_GT(e->version, v7)) {
 		audit_iface(NULL, NULL, NULL, "unsupported interface version",
 			    e, error);
 		return error;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-01  0:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-08 19:50 [PATCH] apparmor: Fix logical error in verify_header() Christos Gkekas
2017-08-01  0:22 ` John Johansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).