Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1693332 - PCP SELinux AVCs
Summary: PCP SELinux AVCs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pcp
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nathan Scott
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-27 14:52 UTC by Marko Myllynen
Modified: 2019-05-03 03:42 UTC (History)
6 users (show)

Fixed In Version: pcp-4.3.2-1.fc30 pcp-4.3.2-1.fc28 pcp-4.3.2-1.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-03 00:58:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Marko Myllynen 2019-03-27 14:52:37 UTC
Description of problem:
Latest PCP git master on an up-to-date Fedora 29:

# ./check -g pmda.bcc
<snip>
# grep denied /var/log/audit/audit.log | grep pcp
type=AVC msg=audit(1553693798.867:610): avc:  denied  { map_create } for  pid=27346 comm="python3" scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=bpf permissive=1
type=AVC msg=audit(1553693798.867:611): avc:  denied  { map_read map_write } for  pid=27346 comm="python3" scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=bpf permissive=1
type=AVC msg=audit(1553693799.123:612): avc:  denied  { prog_load } for  pid=27346 comm="python3" scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=bpf permissive=1
type=AVC msg=audit(1553693799.124:613): avc:  denied  { prog_run } for  pid=27346 comm="python3" scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=bpf permissive=1
# 

Ideally the process of checking for newly appeared AVCs during testing could be automated, perhaps just by merely grep'ing for new PCP AVCs after each QA run (on platforms where applicable). Thanks.

Comment 1 Lukas Berk 2019-03-27 15:11:13 UTC
(In reply to Marko Myllynen from comment #0)
> Ideally the process of checking for newly appeared AVCs during testing could
> be automated, perhaps just by merely grep'ing for new PCP AVCs after each QA
> run (on platforms where applicable). Thanks.

That'd be interesting.  I wonder if we could either

A) Introduce some selinux infrastructure to the check script itself to report avc denials (I don't think this will be well taken upstream)

or

B) Create a new testcase that's artificially high so we can count on it being run last (ie, something like qa/99999) that runs `ausearch -se 'pcp_{pmcd,pmlogger,pmproxy,pmie,etc}_t' --raw` and fails if there's any output.


Just as an aside, due to the nature of PCP as a monitoring framework (always trying to get our hands on new data and areas on the system to monitor) we're always going to be hitting avc denials, especially as selinux gains new context types, classes, etc.  Some of those are dependant on the current state of the system, so individual PCP maintainers won't always hit them first.  It'd be great to know how pcp's src/selinux/README is lacking so that the effort could gain wider adoption.

Comment 2 Nathan Scott 2019-03-27 22:03:59 UTC
(In reply to Lukas Berk from comment #1)
> (In reply to Marko Myllynen from comment #0)
> > Ideally the process of checking for newly appeared AVCs during testing could
> > be automated, perhaps just by merely grep'ing for new PCP AVCs after each QA
> > run (on platforms where applicable). Thanks.
> 
> That'd be interesting.  I wonder if we could either
> 
> A) Introduce some selinux infrastructure to the check script itself to
> report avc denials (I don't think this will be well taken upstream)

Actually, I think it would. :)

There is precedent here - have a look at the way check runs "./994 --fix" after every test (qa/check around line 444), and also the ./check.callback injection point just after that.  These approaches have the advantage of showing which test is triggering the failure - the callback model can also induce the whole QA run to stop.

cheers.

Comment 3 Nathan Scott 2019-04-16 04:53:44 UTC
The AVCs are now resolved in commit 51a509ec4 and the automated test checking is done in e3479c138be...

commit e3479c138be7015791dbd563810eebf5ee1a3942
Author: Nathan Scott <nathans>
Date:   Tue Apr 16 14:33:58 2019 +1000

    qa: extend check.callback.sample to look for selinux AVCs after each test
    
    Add check.callback.sample to the default QA installed set of files, so it
    ends up in pcp-testsuite.  Minor tidyups in check shell code.

commit 51a509ec4a99e2b83e4b59724404f2c8344eae20
Author: Nathan Scott <nathans>
Date:   Tue Apr 16 13:57:45 2019 +1000

    selinux: re-instate BPF type rules to get pmdabpf working again
    
    Resolve Fedora bugzilla #1693332

Comment 4 Fedora Update System 2019-04-26 08:17:06 UTC
pcp-4.3.2-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-89ed2e2383

Comment 5 Fedora Update System 2019-04-26 08:18:34 UTC
pcp-4.3.2-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-30c683f0ae

Comment 6 Fedora Update System 2019-04-26 08:19:31 UTC
pcp-4.3.2-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2f04e77d53

Comment 7 Fedora Update System 2019-04-27 22:30:20 UTC
pcp-4.3.2-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-89ed2e2383

Comment 8 Fedora Update System 2019-04-27 23:11:42 UTC
pcp-4.3.2-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2f04e77d53

Comment 9 Fedora Update System 2019-04-28 00:13:35 UTC
pcp-4.3.2-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-30c683f0ae

Comment 10 Fedora Update System 2019-05-03 00:58:52 UTC
pcp-4.3.2-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2019-05-03 01:35:52 UTC
pcp-4.3.2-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2019-05-03 03:42:01 UTC
pcp-4.3.2-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.