This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 853732 - AVC messages from hplip after turning on my hp psc-1350 printer
AVC messages from hplip after turning on my hp psc-1350 printer
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-02 10:02 EDT by Hans de Goede
Modified: 2012-09-12 19:51 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-12 19:51:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hans de Goede 2012-09-02 10:02:08 EDT
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 05:03:23 EDT
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 07:57:27 EDT
(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 13:11:45 EDT
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 09:25:37 EDT
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 15:37:41 EDT
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 08:32:36 EDT
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 15:12:51 EDT
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 19:51:43 EDT
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.