Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jun 2017 01:17:59 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319890 - head/sys/security/mac_bsdextended
Message-ID:  <201706130117.v5D1HxE5095201@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Tue Jun 13 01:17:58 2017
New Revision: 319890
URL: https://svnweb.freebsd.org/changeset/base/319890

Log:
  Correct bitwise test in mac_bsdextended ugidfw_rule_valid()
  
  PR:		218039
  CID:		1008934
  Reported by:	Coverity, PVS-Studio
  Reviewed by:	kib
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D10300

Modified:
  head/sys/security/mac_bsdextended/mac_bsdextended.c

Modified: head/sys/security/mac_bsdextended/mac_bsdextended.c
==============================================================================
--- head/sys/security/mac_bsdextended/mac_bsdextended.c	Tue Jun 13 01:13:09 2017	(r319889)
+++ head/sys/security/mac_bsdextended/mac_bsdextended.c	Tue Jun 13 01:17:58 2017	(r319890)
@@ -125,7 +125,7 @@ ugidfw_rule_valid(struct mac_bsdextended_rule *rule)
 		return (EINVAL);
 	if ((rule->mbr_object.mbo_neg | MBO_ALL_FLAGS) != MBO_ALL_FLAGS)
 		return (EINVAL);
-	if ((rule->mbr_object.mbo_neg | MBO_TYPE_DEFINED) &&
+	if (((rule->mbr_object.mbo_flags & MBO_TYPE_DEFINED) != 0) &&
 	    (rule->mbr_object.mbo_type | MBO_ALL_TYPE) != MBO_ALL_TYPE)
 		return (EINVAL);
 	if ((rule->mbr_mode | MBI_ALLPERM) != MBI_ALLPERM)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706130117.v5D1HxE5095201>