Bug 1714823 - cron job run daily that calls sa-update throws 100's of AVCs on pgrep
Summary: cron job run daily that calls sa-update throws 100's of AVCs on pgrep
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 30
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-29 01:13 UTC by Doug Maxey
Modified: 2019-06-20 02:54 UTC (History)
10 users (show)

Fixed In Version: selinux-policy-3.14.3-39.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-15 06:27:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
extracted AVCs (719.93 KB, text/plain)
2019-05-29 01:13 UTC, Doug Maxey
no flags Details
the generated .te (2.14 KB, text/plain)
2019-05-29 01:14 UTC, Doug Maxey
no flags Details
the .cil output (3.10 KB, text/plain)
2019-05-29 01:15 UTC, Doug Maxey
no flags Details

Description Doug Maxey 2019-05-29 01:13:48 UTC
Created attachment 1574551 [details]
extracted AVCs

Description of problem:

Install and operation of spamassassin creates a systemd job, via
/usr/lib/systemd/system/sa-update.service

When that service runs, it calls pgrep, which then generates 100's of AVC on access to the /proc fs.

Version-Release number of selected component (if applicable):

spamassassin-3.4.2-4.fc30.x86_64

How reproducible:
100%

Steps to Reproduce:
1. install and start spamassassin
2.
3.

Actual results:


Expected results:


Additional info:

typical AVC:

type=AVC msg=audit(1558501200.531:945): avc:  denied  { getattr } for  pid=19301 comm="pgrep" path="/proc/2" dev="proc" ino=12870 scontext=system_u:system_r:spamd_update_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=dir permissive=0

Comment 1 Doug Maxey 2019-05-29 01:14:24 UTC
Created attachment 1574552 [details]
the generated .te

Comment 2 Doug Maxey 2019-05-29 01:15:10 UTC
Created attachment 1574553 [details]
the .cil output

Comment 3 Kevin Fenzi 2019-05-29 17:46:19 UTC
Moving to selinux-policy for comment. 

This would likely also be fixed by moving sa-update to a proper unit file.

Comment 4 Lukas Vrabec 2019-05-30 09:56:20 UTC
commit 9c3b5d3308f713cb66554ab3d85cffd73861c6fc
Author: Lukas Vrabec <lvrabec>
Date:   Tue May 21 15:39:13 2019 +0200

    Dontaudit spamd_update_t domain to read all domains states BZ(1711799)

Comment 5 Fedora Update System 2019-05-31 08:37:06 UTC
FEDORA-2019-3f20be4d52 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-3f20be4d52

Comment 6 Fedora Update System 2019-06-01 01:35:02 UTC
selinux-policy-3.14.3-38.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-3f20be4d52

Comment 7 Doug Maxey 2019-06-01 07:11:49 UTC
looks good, no messages of course, and no error.

...
Jun  1 00:00:07 host systemd[1]: sa-update.service: Succeeded.

Comment 8 Doug Maxey 2019-06-09 05:41:04 UTC
Alas, after a reboot, the issue returned.

When I tested the update it was applied to the running system, after removing the semanage permissive, and after removing the local module.

On reboot, same behavior as the original open was just noticed after seeing console log, at least message-wise.

[57107.643675] audit_log_start: 7 callbacks suppressed
[57107.643676] audit: audit_backlog=65 > audit_backlog_limit=64
[57107.654554] audit: audit_lost=1 audit_rate_limit=0 audit_backlog_limit=64
[57107.661557] audit: backlog limit exceeded

Investigating that showed the denials.  Nowever, the sa-update appeared to succeed:
Jun  9 00:00:05 xxxx systemd[1]: sa-update.service: Succeeded.

ausearch -m AVC,USER_AVC,SELINUX_ERR --start "06/09/2019" --raw |wc -l
795
# rpm -q selinux-policy
selinux-policy-3.14.3-37.fc30.noarch

Comment 9 Lukas Vrabec 2019-06-12 15:06:38 UTC
Hi Doug, 

You're saying that sa-update succeed, so where you see bug? 

Thanks,
Lukas.

Comment 10 Doug Maxey 2019-06-13 06:51:05 UTC
(In reply to Lukas Vrabec from comment #9)
> Hi Doug, 
> 
> You're saying that sa-update succeed, so where you see bug? 
> 
> Thanks,
> Lukas.

meh. The ~800 log entries complaining about the failed transitions are from the backup mail server, which did *not* get the update.

Just curious, how long will the fix be stuck in updates-testing v. just updates.

Will update this bug status tomorrow, the cronjob ran between when I saw this and pulled from updates-testing on that system. When retrying it didn't actually run sa-update as it had just run.  Or maybe it did, but it sure completed very quickly.

# rpm -q selinux-policy
selinux-policy-3.14.3-38.fc30.noarch

Will know for sure in 24 hours.

Comment 11 Doug Maxey 2019-06-15 06:27:52 UTC
(In reply to Doug Maxey from comment #10)
> (In reply to Lukas Vrabec from comment #9)
> > Hi Doug, 
> > 
> > You're saying that sa-update succeed, so where you see bug? 
> > 
> > Thanks,
> > Lukas.
> 
> meh. The ~800 log entries complaining about the failed transitions are from
> the backup mail server, which did *not* get the update.
> 
> Just curious, how long will the fix be stuck in updates-testing v. just
> updates.
> 
> Will update this bug status tomorrow, the cronjob ran between when I saw
> this and pulled from updates-testing on that system. When retrying it didn't
> actually run sa-update as it had just run.  Or maybe it did, but it sure
> completed very quickly.
> 
> # rpm -q selinux-policy
> selinux-policy-3.14.3-38.fc30.noarch
> 
> Will know for sure in 24 hours.

ok, it was the un-updated version on the alternate server that was complaining.  Once updated, sa-update has no error messages.

Comment 12 Fedora Update System 2019-06-18 11:32:11 UTC
FEDORA-2019-9da5c35472 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-9da5c35472

Comment 13 Fedora Update System 2019-06-19 01:03:02 UTC
selinux-policy-3.14.3-39.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-9da5c35472

Comment 14 Fedora Update System 2019-06-20 02:54:54 UTC
selinux-policy-3.14.3-39.fc30 has been pushed to the Fedora 30 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.