Bug 2050140 - unexpected selinux changes during installation to image
Summary: unexpected selinux changes during installation to image
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: anaconda
Version: 8.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Anaconda Maintenance Team
QA Contact: Release Test Team
Sagar Dubewar
Depends On:
Blocks: 2026666
TreeView+ depends on / blocked
Reported: 2022-02-03 10:51 UTC by Zdenek Veleba
Modified: 2023-01-19 16:12 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
.Unexpected SELinux policies on systems where Anaconda is running as an application When Anaconda is running as an application on an already installed system (for example to perform another installation to an image file using the `–image` anaconda option), the system is not prohibited to modify the SELinux types and attributes during installation. As a consequence, certain elements of SELinux policy might change on the system where Anaconda is running. To work around this problem, do not run Anaconda on the production system and execute it in a temporary virtual machine. So that the SELinux policy on a production system is not modified. Running anaconda as part of the system installation process such as installing from `boot.iso` or `dvd.iso` is not affected by this issue.
Clone Of:
Last Closed: 2022-04-22 15:36:26 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-110940 0 None None None 2022-02-03 10:57:53 UTC

Description Zdenek Veleba 2022-02-03 10:51:12 UTC
Description of problem:
Some selinux types and attributes were changed during the installation to image.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. seinfo --all > seinfo_all_before.out
2. Create disk image `fallocate -l 9G /root/disk.img`
2. Start installation `anaconda --image=/root/disk.img --repo=<url>`
3. Perform minimal installation
3. seinfo --all > seinfo_all_after.out

Actual results:
Full seinfo diff, before and after installation to image:
diff seinfo_all_before.out seinfo_all_after.out 
<   Types:              4946    Attributes:          252
>   Types:              4943    Attributes:          254
<   Allow:            110798    Neverallow:            0
<   Auditallow:          163    Dontaudit:         10258
<   Type_trans:       243938    Type_change:          87
>   Allow:            110675    Neverallow:            0
>   Auditallow:          161    Dontaudit:         10310
>   Type_trans:       241546    Type_change:          87
< Types: 4946
> Types: 4943
<    flatpak_helper_exec_t
<    flatpak_helper_t
>    sandbox_t
<    swtpm_exec_t
<    swtpm_t
< Type Attributes: 252
> Type Attributes: 254
>    sandbox_domain
>    sandbox_typeattr_1

Expected results:
No changes on the "host" system.

Additional info:
It seems that the differences depend on what environment you have and what you are installing to the image.

Comment 6 Jiri Konecny 2022-04-01 10:39:51 UTC
Hi Vlada, could you please take a look on this if it is SELinux or us?

Comment 7 Vladimír Slávik 2022-04-12 17:29:17 UTC
I did not find anything that would explicitly change such things, so I think this effect is indirect and likely not our bug.

In my limited understanding, a system's policy can consist of many files installed by many packages, and this command's output only dumps the sum of all the types from all the files. With that hypothesis, the differences in seinfo output according to installed packages make sense. And changes to the output on host instead of target feel like something is leaking while installing things. It might be useful to see if the same changes occur to installation environment.

Better ask somebody who knows what they are doing...

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