Bug 1165058

Summary: System-Update/avc shows avc error messages while doing TPS testing.
Product: Red Hat Enterprise Linux 7 Reporter: Amita Sharma <amsharma>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.1CC: amsharma, azelinka, isenfeld, lvrabec, mgrepl, mmalik, plautrba, pvrabec
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.13.1-11.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 10:47:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1166674    

Description Amita Sharma 2014-11-18 08:55:12 UTC
Description of problem:
System-Update/avc  shows avc error messages while doing TPS testing.

Version-Release number of selected component (if applicable):
Running 'rpm -q selinux-policy || true'
selinux-policy-3.12.1-153.el7_0.11.noarch

How reproducible:
Always

Steps to Reproduce:
Executing TPS tests for errata :: https://errata.devel.redhat.com/tps/errata_results/21326

Actual results:
AVC error messages ::
====================
Info: Searching AVC errors produced since 1416293863.06 (Tue Nov 18 01:57:43 2014)
Searching logs...
Running '/usr/bin/env LC_ALL=en_US.UTF-8 /sbin/ausearch -m AVC -m USER_AVC -m SELINUX_ERR -ts 11/18/2014 01:57:43 < /dev/null >/mnt/testarea/tmp.rhts-db-submit-result.N_JVVW 2>&1'
----
time->Tue Nov 18 02:03:49 2014
type=USER_AVC msg=audit(1416294229.397:79): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  received policyload notice (seqno=2)  exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
----
time->Tue Nov 18 02:03:46 2014
type=SYSCALL msg=audit(1416294226.434:78): arch=c000003e syscall=59 success=yes exit=0 a0=11db560 a1=11da740 a2=11d9400 a3=7fff90abe820 items=0 ppid=29934 pid=29935 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="newaliases" exe="/usr/sbin/sendmail.postfix" subj=unconfined_u:system_r:system_mail_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1416294226.434:78): avc:  denied  { read } for  pid=29935 comm="newaliases" path="/tmp/tmp.7k6C3Huf9e" dev="dm-0" ino=202060480 scontext=unconfined_u:system_r:system_mail_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=dir
type=AVC msg=audit(1416294226.434:78): avc:  denied  { read } for  pid=29935 comm="newaliases" path="/tmp/tmp.7k6C3Huf9e" dev="dm-0" ino=202060480 scontext=unconfined_u:system_r:system_mail_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=dir
Fail: AVC messages found.
Checking for errors...
Using stronger AVC checks.
	Define empty RHTS_OPTION_STRONGER_AVC parameter if this causes any problems.
Running 'cat /mnt/testarea/tmp.rhts-db-submit-result.N_JVVW | /sbin/ausearch -m AVC -m SELINUX_ERR'
Fail: AVC messages found.
Running 'cat %s | /sbin/ausearch -m USER_AVC >/mnt/testarea/tmp.rhts-db-submit-result.2_AryP 2>&1'
Info: No AVC messages found.
/bin/grep 'avc: ' /mnt/testarea/dmesg.log | /bin/grep --invert-match TESTOUT.log
No AVC messages found in dmesg
Running '/usr/sbin/sestatus'
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
Running 'rpm -q selinux-policy || true'
selinux-policy-3.12.1-153.el7_0.11.noarch


Expected results:
No AVC error message should show up.

Additional info:
This happened for all 4 variants.

Comment 2 Miroslav Grepl 2014-11-18 09:11:11 UTC
Is this a part of this test? I mean newaliases wants to access /tmp/tmp.7k6C3Huf9e?

Comment 3 Iveta Wiedermann 2014-11-18 15:34:19 UTC
I probably hit the same issue today:

time->Tue Nov 18 15:38:02 2014
type=SYSCALL msg=audit(1416321482.211:51): arch=c000003e syscall=59 success=yes exit=0 a0=a4d570 a1=a4c7a0 a2=a4b430 a3=7fff8748acf0 items=0 ppid=19639 pid=19640 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=51 sgid=51 fsgid=51 tty=(none) ses=4294967295 comm="newaliases" exe="/usr/sbin/sendmail.sendmail" subj=unconfined_u:system_r:system_mail_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1416321482.211:51): avc:  denied  { read } for  pid=19640 comm="newaliases" path="/tmp/tmp.1gcBsNv09m" dev="dm-1" ino=202462602 scontext=unconfined_u:system_r:system_mail_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=dir
type=AVC msg=audit(1416321482.211:51): avc:  denied  { read } for  pid=19640 comm="newaliases" path="/tmp/tmp.1gcBsNv09m" dev="dm-1" ino=202462602 scontext=unconfined_u:system_r:system_mail_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=dir

It happened during  System-Update as well.

Comment 4 Miroslav Grepl 2014-11-21 11:43:05 UTC
It looks like a leak. Do you know who creates /tmp/tmp.7k6C3Huf9e?

Comment 5 Miroslav Grepl 2014-11-24 09:53:42 UTC
commit 3a80f06682910715e5bd14cafabb726cad6a7f8f
Author: Miroslav Grepl <mgrepl>
Date:   Mon Nov 24 10:53:14 2014 +0100

    Dontaudit list user_tmp files for system_mail_t.

Comment 10 errata-xmlrpc 2015-03-05 10:47:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0458.html

Comment 11 Red Hat Bugzilla 2023-09-14 02:51:00 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days