Bug 853732 - AVC messages from hplip after turning on my hp psc-1350 printer
Summary: AVC messages from hplip after turning on my hp psc-1350 printer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-02 14:02 UTC by Hans de Goede
Modified: 2012-09-12 23:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-12 23:51:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Hans de Goede 2012-09-02 14:02:08 UTC
Hi,

I've just upgraded to F-18, and I've noticed the following messages in dmesg when running in permissive mode:

[   87.411333] type=1400 audit(1346591594.833:6): avc:  denied  { read } for  pid=1459 comm="hpfax" name="nsswitch.conf" dev="sdb1" ino=919650 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file
[   87.411423] type=1400 audit(1346591594.833:7): avc:  denied  { open } for  pid=1459 comm="hpfax" path="/etc/nsswitch.conf" dev="sdb1" ino=919650 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file
[   87.411977] type=1400 audit(1346591594.834:8): avc:  denied  { getattr } for  pid=1459 comm="hpfax" path="/etc/nsswitch.conf" dev="sdb1" ino=919650 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file

Here is the matching audit,log contents from a *different boot*, this time in enforcing mode, so it stops after the first read:

type=AVC msg=audit(1346594180.814:65): avc:  denied  { read } for  pid=1512 comm="hpfax" name="nsswitch.conf" dev="sdb1" ino=919650 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file
type=SYSCALL msg=audit(1346594180.814:65): arch=c000003e syscall=2 success=no exit=-13 a0=7f3cec89a3d2 a1=80000 a2=1b6 a3=238 items=0 ppid=1507 pid=1512 auid=4294967295 uid=0 gid=7 euid=0 suid=0 fsuid=0 egid=7 sgid=7 fsgid=7 tty=(none) ses=4294967295 comm="hpfax" exe="/usr/bin/python2.7" subj=system_u:system_r:hplip_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1346594180.815:66): avc:  denied  { read } for  pid=1512 comm="hpfax" name="nsswitch.conf" dev="sdb1" ino=919650 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file
type=SYSCALL msg=audit(1346594180.815:66): arch=c000003e syscall=2 success=no exit=-13 a0=7f3cec89a3d2 a1=80000 a2=1b6 a3=238 items=0 ppid=1507 pid=1512 auid=4294967295 uid=0 gid=7 euid=0 suid=0 fsuid=0 egid=7 sgid=7 fsgid=7 tty=(none) ses=4294967295 comm="hpfax" exe="/usr/bin/python2.7" subj=system_u:system_r:hplip_t:s0-s0:c0.c1023 key=(null)

Regards,

Hans

Comment 1 Miroslav Grepl 2012-09-03 09:03:23 UTC
The problem is 

nsswitch.conf

is mislabeled. Something is wrong on an upgrade.

$ restorecon -R -v /etc/nsswitch.conf

will fix it.

What does

# rpm -qa --scripts |grep nsswitch

Comment 2 Hans de Goede 2012-09-03 11:57:27 UTC
(In reply to comment #1)
> The problem is 
> 
> nsswitch.conf
> 
> is mislabeled. Something is wrong on an upgrade.
> 
> $ restorecon -R -v /etc/nsswitch.conf
> 
> will fix it.

I already did a "fixfiles onboot; reboot" and then checked again before filing any selinux bugs:

[hans@shalem qemu]$ ls -Z /etc/nsswitch.conf
-rw-r--r--. root root system_u:object_r:etc_t:s0       /etc/nsswitch.conf
[hans@shalem qemu]$ restorecon -R -v /etc/nsswitch.conf
[hans@shalem qemu]$ ls -Z /etc/nsswitch.conf
-rw-r--r--. root root system_u:object_r:etc_t:s0       /etc/nsswitch.conf
[hans@shalem qemu]$

> What does
> 
> # rpm -qa --scripts |grep nsswitch

[hans@shalem qemu]$ rpm -qa --scripts |grep nsswitch

# sed-fu to add myhostname to the hosts line of /etc/nsswitch.conf
if [ -f /etc/nsswitch.conf ] ; then
                ' /etc/nsswitch.conf
# sed-fu to remove myhostname from the hosts line of /etc/nsswitch.conf
if [ "$1" -eq 0 -a -f /etc/nsswitch.conf ] ; then
                ' /etc/nsswitch.conf
if ! grep -s -q '^hosts: \+files \+dns *$' /etc/nsswitch.conf;then
     cat /etc/nsswitch.conf >/usr/share/lsb/nsswitch.conf.orig
     ed -s /etc/nsswitch.conf <<EOF
cat /etc/nsswitch.conf >/usr/share/lsb/nsswitch.conf
    if [ -e /usr/share/lsb/nsswitch.conf -a -e  /usr/share/lsb/nsswitch.conf.orig ];then
        if cmp -s /usr/share/lsb/nsswitch.conf /etc/nsswitch.conf;then
            cat /usr/share/lsb/nsswitch.conf.orig >/etc/nsswitch.conf
        rm -f /usr/share/lsb/{nsswitch.conf,nsswitch.conf.orig}
# Perl-fu to add mdns4_minimal to the hosts line of /etc/nsswitch.conf
if [ -f /etc/nsswitch.conf ] ; then
                ' /etc/nsswitch.conf
# sed-fu to remove mdns4_minimal from the hosts line of /etc/nsswitch.conf
if [ "$1" -eq 0 -a -f /etc/nsswitch.conf ] ; then
        ' /etc/nsswitch.conf

Comment 3 Miroslav Grepl 2012-09-03 17:11:45 UTC
I apologize, this is a valid bug. I read "resolv.con" instead of "nsswitch.conf".

Added a fix. Thanks.

Comment 4 Fedora Update System 2012-09-07 13:25:37 UTC
selinux-policy-3.11.1-16.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-16.fc18

Comment 5 Fedora Update System 2012-09-07 19:37:41 UTC
Package selinux-policy-3.11.1-16.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-16.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-13554/selinux-policy-3.11.1-16.fc18
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-09-12 12:32:36 UTC
selinux-policy-3.11.1-18.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/FEDORA-2012-13554/selinux-policy-3.11.1-18.fc18

Comment 7 Fedora Update System 2012-09-12 19:12:51 UTC
Package selinux-policy-3.11.1-18.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-18.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-13554/selinux-policy-3.11.1-18.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-09-12 23:51:43 UTC
selinux-policy-3.11.1-18.fc18 has been pushed to the Fedora 18 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.