Bug 890709 - SELinux is preventing /usr/bin/python2.7 from 'open' accesses on the file /var/lib/rpm/__db.001.
Summary: SELinux is preventing /usr/bin/python2.7 from 'open' accesses on the file /va...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: abrt
Version: 23
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Martin Milata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:51e27468f17c0d10e5e44cdbd0a...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-29 00:16 UTC by Bernardo Barros
Modified: 2016-12-20 12:32 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-12-20 12:32:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: type (9 bytes, text/plain)
2012-12-29 00:17 UTC, Bernardo Barros
no flags Details
File: hashmarkername (14 bytes, text/plain)
2012-12-29 00:17 UTC, Bernardo Barros
no flags Details
"journalctl | grep tuned" after "systemctl start tuned" (14.62 KB, text/plain)
2013-02-12 02:27 UTC, Scott Schmit
no flags Details

Description Bernardo Barros 2012-12-29 00:16:58 UTC
Additional info:
libreport version: 2.0.18
kernel:         3.4.21-1.rt32.1.fc17.ccrma.x86_64.rt

description:
:SELinux is preventing /usr/bin/python2.7 from 'open' accesses on the file /var/lib/rpm/__db.001.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that python2.7 should be allowed open access on the __db.001 file by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep tuned /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:tuned_t:s0
:Target Context                system_u:object_r:rpm_var_lib_t:s0
:Target Objects                /var/lib/rpm/__db.001 [ file ]
:Source                        tuned
:Source Path                   /usr/bin/python2.7
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           python-2.7.3-7.2.fc17.x86_64
:Target RPM Packages           rpm-4.9.1.3-7.fc17.x86_64
:Policy RPM                    selinux-policy-3.10.0-161.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Permissive
:Host Name                     (removed)
:Platform                      Linux (removed)
:                              3.4.21-1.rt32.1.fc17.ccrma.x86_64.rt #1 SMP
:                              PREEMPT RT Fri Dec 7 10:02:23 PST 2012 x86_64
:                              x86_64
:Alert Count                   5
:First Seen                    2012-12-28 20:22:06 BRT
:Last Seen                     2012-12-28 21:13:50 BRT
:Local ID                      389d2520-d1e8-4bfa-9845-bfd7b8794ff3
:
:Raw Audit Messages
:type=AVC msg=audit(1356740030.554:148): avc:  denied  { open } for  pid=4315 comm="tuned" name="__db.001" dev="sda2" ino=983 scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1356740030.554:148): arch=x86_64 syscall=open success=yes exit=EINTR a0=14db6b0 a1=2 a2=0 a3=16 items=0 ppid=1 pid=4315 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=tuned exe=/usr/bin/python2.7 subj=system_u:system_r:tuned_t:s0 key=(null)
:
:Hash: tuned,tuned_t,rpm_var_lib_t,file,open
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Bernardo Barros 2012-12-29 00:17:02 UTC
Created attachment 670003 [details]
File: type

Comment 2 Bernardo Barros 2012-12-29 00:17:04 UTC
Created attachment 670004 [details]
File: hashmarkername

Comment 3 Daniel Walsh 2013-01-02 19:54:45 UTC
Is tuned reading the rpm database?

Comment 4 Jaroslav Škarvada 2013-01-03 11:22:33 UTC
(In reply to comment #3)
> Is tuned reading the rpm database?

It shouldn't be.

No idea what's the source.

Comment 5 Jaroslav Škarvada 2013-01-03 11:23:10 UTC
Bernardo, do you have reproducer for this? Which tuned profile did you use?

Comment 6 Daniel Walsh 2013-01-03 21:32:26 UTC
import rpm ???

Comment 7 Jaroslav Škarvada 2013-01-04 09:45:05 UTC
(In reply to comment #6)
> import rpm ???

I cannot see this in the code, nor trace, tuned-2.0.1-5.fc17

Comment 8 Daniel Walsh 2013-01-04 18:26:19 UTC
Does tuned use plugins?

Comment 9 Jaroslav Škarvada 2013-01-07 08:42:25 UTC
(In reply to comment #8)
> Does tuned use plugins?

It may be caused by user customized profile / commands in the profile.

I am unable to reproduce this on my machines. Waiting for more info from reporter.

Comment 10 Fedora Admin XMLRPC Client 2013-02-04 21:45:10 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 11 Scott Schmit 2013-02-09 04:26:19 UTC
I hit this bug, and all I did was yum install tuned; systemctl enable tuned; systemctl start tuned

(On Fedora 18).

Comment 12 Jaroslav Škarvada 2013-02-11 14:28:43 UTC
I have selinux-policy-3.11.1-76.fc18 and I am unable to reproduce the AVC. Is there already noaudit rule for this?

Maybe I got the source of this problem. There is abrt hook installed by abrt-addon-python which fires in case of exception, it imports rpm and touches the db. It maybe the source of this AVC.

Bernardo or Scott could you please upload an output of the following command (as an attachment):
# journalctl | grep tuned

Comment 13 Jaroslav Škarvada 2013-02-11 14:45:19 UTC
(In reply to comment #12)
> I have selinux-policy-3.11.1-76.fc18 and I am unable to reproduce the AVC.
> Is there already noaudit rule for this?
> 
I rebuilt the policy without noaudit rules and got the following AVC:

type=AVC msg=audit(1360593646.225:273): avc:  denied  { getattr } for  pid=10626 comm="tuned" path="/var/lib/rpm" dev="dm-1" ino=1310739 scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=dir

> Maybe I got the source of this problem. There is abrt hook installed by
> abrt-addon-python which fires in case of exception, it imports rpm and
> touches the db. It maybe the source of this AVC.
> 
With /usr/lib/python2.7/site-packages/abrt.pth hook removed there is no AVC.

Well it is different AVC, but I suspect the source is the same.

Comment 14 Scott Schmit 2013-02-12 02:27:46 UTC
Created attachment 696345 [details]
"journalctl | grep tuned" after "systemctl start tuned"

See attachment

Comment 15 Jiri Moskovcak 2013-02-12 08:22:45 UTC
ABRT python hook reads the rpm database, so it's very possible that the AVC is caused by our code. However it needs to read it.

Comment 16 Jaroslav Škarvada 2013-02-12 13:56:53 UTC
(In reply to comment #14)
> Created attachment 696345 [details]
> "journalctl | grep tuned" after "systemctl start tuned"
> 
> See attachment

Thanks, it's clear now. From the journalctl log it seems you are also affected by bug 909445 which raises an exception. This exception is catched by abrt and it results in this AVC. In case there is no exception it is not reproducible (that's why I was not successful reproducing this in comment 7). I think the best we can do now is dontaudit. Reassigning to selinux guys - feel free to close this in case there is already dontaudit rule in the current policy.

Comment 17 Daniel Walsh 2013-02-12 18:00:33 UTC
Why does abrt need to read the rpm database?

Comment 18 Jiri Moskovcak 2013-02-13 07:44:07 UTC
If the rpm database is available it stores the NEVRA of packages participating in the crash. For this it needs the exception object so it has to happen in the exception handler in the crashing program.

Comment 19 Jaroslav Škarvada 2013-02-18 14:49:04 UTC
I think the python hook could be simplified not to do it, filled RFE bug 912378.

Comment 20 Fedora End Of Life 2013-07-04 00:55:25 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 21 Jan Kurik 2015-07-15 14:54:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 22 Fedora End Of Life 2016-11-24 10:53:05 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 23 Fedora End Of Life 2016-12-20 12:32:17 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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