Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1513720 - SELinux is preventing abrt-action-lis from 'map' accesses on the archivo /var/lib/rpm/Basenames.
Summary: SELinux is preventing abrt-action-lis from 'map' accesses on the archivo /var...
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 27
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:6c5b81c9f4747d9f6af192243c3...
: 1482354 1539377 1539605 1540820 1542776 1542804 1630496 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2017-11-15 20:42 UTC by Rubén Lledó
Modified: 2018-11-30 22:50 UTC (History)
28 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-11-30 22:50:08 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1495817 None CLOSED SELinux is preventing setroubleshootd from read access on the file /var/lib/rpm/Packages. 2019-01-24 21:45:34 UTC

Internal Links: 1495817

Description Rubén Lledó 2017-11-15 20:42:42 UTC
Description of problem:
SELinux is preventing abrt-action-lis from 'map' accesses on the archivo /var/lib/rpm/Basenames.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If quiere arreglar la etiqueta.
La etiqueta predeterminada de /var/lib/rpm/Basenames debería ser rpm_var_lib_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
# /sbin/restorecon -v /var/lib/rpm/Basenames

*****  Plugin catchall (1.49 confidence) suggests   **************************

If cree que de manera predeterminada, abrt-action-lis debería permitir acceso map sobre Basenames file.     
Then debería reportar esto como un error.
Puede generar un módulo de política local para permitir este acceso.
allow this access for now by executing:
# ausearch -c 'abrt-action-lis' --raw | audit2allow -M my-abrtactionlis
# semodule -X 300 -i my-abrtactionlis.pp

Additional Information:
Source Context                system_u:system_r:abrt_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:var_lib_t:s0
Target Objects                /var/lib/rpm/Basenames [ file ]
Source                        abrt-action-lis
Source Path                   abrt-action-lis
Port                          <Desconocido>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    <Desconocido>
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.13.12-300.fc27.x86_64 #1 SMP Wed
                              Nov 8 16:38:01 UTC 2017 x86_64 x86_64
Alert Count                   1045
First Seen                    2017-11-14 23:17:47 CET
Last Seen                     2017-11-15 21:33:31 CET
Local ID                      5a25185e-f2dd-46b9-b333-81dca9da02b4

Raw Audit Messages
type=AVC msg=audit(1510778011.576:4094): avc:  denied  { map } for  pid=12015 comm="abrt-action-lis" path="/var/lib/rpm/Basenames" dev="dm-0" ino=265936 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file permissive=0

Hash: abrt-action-lis,abrt_t,var_lib_t,file,map

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.13.12-300.fc27.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2017-11-16 11:19:15 UTC
Hi rpm team, 

Is there any change how Basenames file is created or created in other path and then moved to /var/lib/rpm/ ? These is a wrong label for this file so we need to know how is this file created. 


Comment 2 utrescu 2017-11-26 21:53:56 UTC
Description of problem:
Opennig different programs

Additional info:
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.13.13-300.fc27.x86_64
type:           libreport

Comment 3 Panu Matilainen 2017-11-27 11:09:54 UTC
I dont think creation of initial db has changed in any way, but --rebuilddb operates quite differently now: it replaces the entire /var/lib/rpm directory instead of moving individual db files around from a rebuild directory.

The new db gets created in /var/lib/rpmrebuilddb.<pid> (as it always was), I think there even used to be a policy for that but it only never worked right, probably because /usr/bin/rpmdb (which is the executable that actually does the db rebuild) has just a generic bin_t context:

[root@sopuli ~]# ls -lZ /usr/bin/rpmdb
-rwxr-xr-x. 1 root root system_u:object_r:bin_t:s0 15976 Nov  1 15:40 /usr/bin/rpmdb

Comment 4 Daniel Rusek 2017-11-30 13:58:30 UTC
*** Bug 1519249 has been marked as a duplicate of this bug. ***

Comment 5 Lukas Vrabec 2017-12-11 14:37:46 UTC

Could you do following: 

# semanage fcontext -a -t rpm_exec_t /usr/bin/rpmdb

Then try to do rebuild and see if label for /var/lib/rpm/Basenames is right one? 


Comment 6 Panu Matilainen 2017-12-12 08:16:58 UTC
Nope, doesn't help. I think somebody in a related bug said it did, but at least in F27 it doesn't.

But... looking closer at that rebuilddb context rule, this doesn't seem right, and certainly doesn't do anything:

/var/lib/rpmrebuilddb.*(/.*)?  gen_context(system_u:object_r:rpm_var_lib_t,s0)

The rebuilddb directory path is /var/lib/rpmrebuilddb.<pid>, and the above is trying to match two or more characters where there only is one '.', which would explain why the above rule doesn't seem to do anything at all.

Is there a way to try that without rebuilding the whole selinux-policy?

Comment 7 Lukas Vrabec 2017-12-12 12:37:50 UTC
You can try this: 

# semanage fcontext -a -t rpm_var_lib_t "/var/lib/rpmrebuilddb(/.*)?"

But I afraid it won't help. But try it please.

Comment 8 Rubén Lledó 2018-01-13 21:11:17 UTC
Description of problem:
After typing "dnf history list". dnf-automatic install timer was enabled and running:

$ sudo systemctl list-timers
[sudo] password for ruben: 
NEXT                         LEFT          LAST                         PASSED       UNIT                         ACTIVATES
Sat 2018-01-13 22:32:59 CET  26min left    Sat 2018-01-13 21:32:55 CET  33min ago    dnf-makecache.timer          dnf-makeca
Sun 2018-01-14 00:00:00 CET  1h 53min left Sat 2018-01-13 00:00:00 CET  22h ago      unbound-anchor.timer         unbound-an
Sun 2018-01-14 20:37:41 CET  22h left      Sat 2018-01-13 20:37:41 CET  1h 28min ago systemd-tmpfiles-clean.timer systemd-tm
n/a                          n/a           Sat 2018-01-13 21:22:42 CET  43min ago    dnf-automatic-install.timer  dnf-automa

4 timers listed.
Pass --all to see loaded but inactive timers, too.

sudo dnf check-update
Última comprobación de caducidad de metadatos hecha hace 1:34:02, el sáb 13 ene 2018 20:32:52 CET.
Security: kernel-core-4.14.13-300.fc27.x86_64 is an installed security update
Security: kernel-core-4.14.11-300.fc27.x86_64 is the currently running version
 ruben  ~  sudo dnf history list
Traceback (most recent call last):
  File "/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 115, in cli_run
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 1014, in run
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/", line 971, in run
    ret = self.output.historyListCmd(self.transaction_ids)
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 1479, in historyListCmd
    tids = self._history_list_transactions(extcmds)
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 1441, in _history_list_transactions
    old = self.history.last()
  File "/usr/lib/python3.6/site-packages/dnf/yum/", line 1313, in last
    ret = self.old([], 1, complete_transactions_only)
  File "/usr/lib/python3.6/site-packages/dnf/yum/", line 1262, in old
    executeSQL(cur, sql, params)
  File "/usr/lib/python3.6/site-packages/dnf/yum/", line 167, in executeSQLQmark
    return cursor.execute(query)
sqlite3.OperationalError: database is locked

Additional info:
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.14.11-300.fc27.x86_64
type:           libreport

Comment 9 Panu Matilainen 2018-02-07 09:06:02 UTC
*** Bug 1542804 has been marked as a duplicate of this bug. ***

Comment 10 Panu Matilainen 2018-02-07 09:15:33 UTC
*** Bug 1539377 has been marked as a duplicate of this bug. ***

Comment 11 Panu Matilainen 2018-02-07 09:15:40 UTC
*** Bug 1539605 has been marked as a duplicate of this bug. ***

Comment 12 Panu Matilainen 2018-02-07 09:15:46 UTC
*** Bug 1540820 has been marked as a duplicate of this bug. ***

Comment 13 Panu Matilainen 2018-02-07 09:15:54 UTC
*** Bug 1542776 has been marked as a duplicate of this bug. ***

Comment 14 Panu Matilainen 2018-02-07 09:22:19 UTC
*** Bug 1482354 has been marked as a duplicate of this bug. ***

Comment 15 Panu Matilainen 2018-02-07 09:40:24 UTC
(In reply to Lukas Vrabec from comment #7)
> You can try this: 
> # semanage fcontext -a -t rpm_var_lib_t "/var/lib/rpmrebuilddb(/.*)?"
> But I afraid it won't help. But try it please.

No it doesn't. And now that I think of it, somebody in some related bug didn't say *that* would fix it, but had some other slightly more complicated thing that did. Only I can't find the bug now :(

However I believe it had to do with what dwalsh says here: - the unconfined_t -> rpm_t transition is missing and apparently the fix never made it anywhere.

Comment 16 Artemio 2018-02-10 09:30:30 UTC
*** Bug 1544100 has been marked as a duplicate of this bug. ***

Comment 17 edo 2018-02-19 13:15:54 UTC
Description of problem:
Open file manager

Version-Release number of selected component:

Additional info:
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.15.3-300.fc27.x86_64
type:           libreport

Comment 18 Sergei 2018-04-05 12:09:23 UTC
Description of problem:
Upon installation of Fedora Workstation 27 I already had working distro (OpenSUSE 42.2) installed. 
I did not use selinux in that installation (OpenSUSE).
In OpenSUSE I had (and in Fedora I still have) a distinct partition for /home directory.
I did not format /home partition upon installation of Fedora Workstation 27.
After install I had to chcon /home, and /home/<user-name> in order SDDM to login and to eliminate "logging with / as home" in console.
Now I receive sealert a couple of times a day about some directories in ~/.local even though I did chcon for these directories and restorecon as SELinux Alert Browser suggested,

Additional info:
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.15.14-300.fc27.x86_64
type:           libreport

Comment 19 Panu Matilainen 2018-10-15 07:48:08 UTC
*** Bug 1630496 has been marked as a duplicate of this bug. ***

Comment 20 Ben Cotton 2018-11-27 13:31:55 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. 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 '27'.

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 27 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 21 Ben Cotton 2018-11-30 22:50:08 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 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

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.