Bug 2166153
Summary: | Rebuilding of rpm db set wrong SELinux context | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Brad Hubbard <bhubbard> |
Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> |
Status: | CLOSED WONTFIX | QA Contact: | BaseOS QE Security Team <qe-baseos-security> |
Severity: | medium | Docs Contact: | Jan Fiala <jafiala> |
Priority: | medium | ||
Version: | 8.7 | CC: | 7d28c752, al.dunsmuir, arya.senna, bitlord0xff, bztdlinux, capl, cberlinger, Claude.Frantz, collura, daniel-fedoauth, david.abdurachmanov, dhcpme, dkaylor, dmick, dwalsh, ed.greshko, ego.cordatus, egor.artemov, extras-qa, fedora, ffesti, fukidid, gregory.lee.bartholomew, heldwin, hornaman, htl10, ignatenko, jan.vesely, kardos.lubos, kmansoft, knst.kolinko, Krause.Markus, kvolny, lslebodn, lvrabec, mattdm, mattia.verga, mdaenzer, mgrepl, mh, michael, mikael.bjarmkvist, mikhail.v.gavrilov, mmalik, mtessun, ncoghlan, ndbecker2, nixuser, nknazeko, nmg921, noloader, nospam, omichael, packaging-team-maint, plautrba, pmatilai, pmoore, ppywlkiqletw, prarit, pwolfes, rafal.boruc, redhat-bugzilla, redhat, ryan, samuel-rhbugs, sbauza, shawn, ssidhaye, stefan.hoelldampf, stephenbryant, thedatum+bz, the, tony, vmukhame, vondruch, wdh, wizor2, zpytela |
Target Milestone: | rc | Keywords: | Reopened, Triaged |
Target Release: | 8.9 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Known Issue | |
Doc Text: |
.Rebuilding the `rpm` database assigns incorrect SELinux labeling
Rebuilding the `rpm` database with the `rpmdb --rebuilddb` command assigns incorrect SELinux labels to the `rpm` database files. As a consequence, some services that use the `rpm` database might not work correctly. To work around this problem after rebuilding the database, relabel the database by using the `restorecon -Rv /var/lib/rpm` command.
|
Story Points: | --- |
Clone Of: | 1461313 | Environment: | |
Last Closed: | 2023-06-15 07:45:48 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: | 1461313 | ||
Bug Blocks: |
Description
Brad Hubbard
2023-02-01 00:44:19 UTC
Had to truncate the description so refer to https://bugzilla.redhat.com/show_bug.cgi?id=1461313 for full details. Seeing this on the following. # cat /etc/os-release NAME="Red Hat Enterprise Linux" VERSION="8.7 (Ootpa)" ID="rhel" ID_LIKE="fedora" VERSION_ID="8.7" PLATFORM_ID="platform:el8" PRETTY_NAME="Red Hat Enterprise Linux 8.7 (Ootpa)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos" HOME_URL="https://www.redhat.com/" DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.7 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.7" # rpm -q selinux-policy-targeted selinux-policy-targeted-3.14.3-108.el8.noarch # ls -Z /var/lib/rpm/Packages system_u:object_r:rpm_var_lib_t:s0 /var/lib/rpm/Packages # rpmdb --rebuilddb # ls -Z /var/lib/rpm/Packages unconfined_u:object_r:var_lib_t:s0 /var/lib/rpm/Packages This is causing problems in our testing environment as denials are being generated causing the tests to fail. I see similar behaviour on rhel9. Let me know if you want me to clone this for 9. # cat /etc/os-release NAME="Red Hat Enterprise Linux" VERSION="9.1 (Plow)" ID="rhel" ID_LIKE="fedora" VERSION_ID="9.1" PLATFORM_ID="platform:el9" PRETTY_NAME="Red Hat Enterprise Linux 9.1 (Plow)" ANSI_COLOR="0;31" LOGO="fedora-logo-icon" CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos" HOME_URL="https://www.redhat.com/" DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/9/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9" REDHAT_BUGZILLA_PRODUCT_VERSION=9.1 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="9.1" # rpm -q selinux-policy-targeted selinux-policy-targeted-34.1.43-1.el9.noarch # ls -Z /var/lib/rpm/ system_u:object_r:rpm_var_lib_t:s0 rpmdb.sqlite system_u:object_r:rpm_var_lib_t:s0 rpmdb.sqlite-shm system_u:object_r:rpm_var_lib_t:s0 rpmdb.sqlite-wal # rpmdb --rebuilddb # ls -Z /var/lib/rpm/ unconfined_u:object_r:rpm_var_lib_t:s0 rpmdb.sqlite unconfined_u:object_r:rpm_var_lib_t:s0 rpmdb.sqlite-shm unconfined_u:object_r:rpm_var_lib_t:s0 rpmdb.sqlite-wal Never mind. Reopening as I confused myself. Sorry about this. The issue is present in rhel8, but not rhel9. Just so we are clear comment #2 is incorrect and should be ignored. Please don't clone Fedora Bugzillas with 83 CC'ed folks to RHEL. This issue was not selected to be included in Red Hat Enterprise Linux 8 as there would be a new SELinux type for rpmdb needed to be introduced with a non-negligible risk of regression. We will now close this issue, but if you believe that the decision needs to be reconsidered, feel free to reopen this bug and attach information regarding severity of the bugzilla. As a workaround, it is recommended to run restorecon after rebuilding the database from a command line. # restorecon -Rv /var/lib/rpm |