Bug 218039 - sys/security/mac_bsdextended/mac_bsdextended.c: PVS-Studio: Expression is Always True (CWE-571)
Summary: sys/security/mac_bsdextended/mac_bsdextended.c: PVS-Studio: Expression is Alw...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Ed Maste
URL: https://reviews.freebsd.org/D10300
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-03-23 12:53 UTC by Svyatoslav
Modified: 2017-07-16 19:29 UTC (History)
3 users (show)

See Also:


Attachments
git patch (694 bytes, patch)
2017-03-23 12:53 UTC, Svyatoslav
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svyatoslav 2017-03-23 12:53:21 UTC
Created attachment 181098 [details]
git patch

We have found and fixed a weakness using PVS-Studio tool. PVS-Studio is a static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/

Analyzer warning: V617 Consider inspecting the condition. The '0x00000080' argument of the '|' bitwise operation contains a non-zero value. mac_bsdextended.c 128
Comment 1 Ed Maste freebsd_committer 2017-04-06 14:51:02 UTC
I suspect this is supposed to be & instead of |
Comment 2 Ed Maste freebsd_committer 2017-04-06 21:05:57 UTC
Also CID 1008934
Comment 3 commit-hook freebsd_committer 2017-06-13 01:18:12 UTC
A commit references this bug:

Author: emaste
Date: Tue Jun 13 01:17:59 UTC 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

Changes:
  head/sys/security/mac_bsdextended/mac_bsdextended.c
Comment 4 commit-hook freebsd_committer 2017-07-16 19:25:14 UTC
A commit references this bug:

Author: emaste
Date: Sun Jul 16 19:24:10 UTC 2017
New revision: 321055
URL: https://svnweb.freebsd.org/changeset/base/321055

Log:
  MFC r319890: Correct bitwise test in mac_bsdextended ugidfw_rule_valid()

  PR:		218039
  CID:		1008934
  Reported by:	Coverity, PVS-Studio
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/sys/security/mac_bsdextended/mac_bsdextended.c
Comment 5 commit-hook freebsd_committer 2017-07-16 19:26:18 UTC
A commit references this bug:

Author: emaste
Date: Sun Jul 16 19:25:18 UTC 2017
New revision: 321056
URL: https://svnweb.freebsd.org/changeset/base/321056

Log:
  MFC r319890: Correct bitwise test in mac_bsdextended ugidfw_rule_valid()

  PR:		218039
  CID:		1008934
  Reported by:	Coverity, PVS-Studio
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/10/
  stable/10/sys/security/mac_bsdextended/mac_bsdextended.c