Skip to content

rhel8 rebase fails due to SELinux mac_admin #314

Closed

Description

@cgwalters
Jan 15 21:51:42 osiris-worker-0-c2bsp kernel: type=1400 audit(1547589102.431:14): avc:  denied  { mac_admin } for  pid=56093 comm="pool" capability=33  scontext=system_u:system_r:spc_t:s0 tcontext=system_u:system_r:spc_t:s0 tclass=capability2 permissive=0

We have a special install_exec_t label for rpm-ostreed (see e.g. coreos/rpm-ostree#953 coreos/rpm-ostree#292 (comment) )

But we're not using that because we're executing pivot from the MCD. One option (I think) is to use systemd-run for pivot. Downside is that the logs go to the journal, not the MCD, but we can scrape them?

EDIT: Actually the problem is:

I0115 21:55:07.102216   63098 run.go:14] Running: ostree pull-local srv/repo 9249e2dc8c0adf821ad4c43545900aa94b96216401a3d615799666454771dc03
error: Writing content object: fsetxattr: Invalid argument

So we're skipping rpm-ostreed. Hmm. Maybe the best would be to change pivot to add a file:/// remote and then we rebase to it? Another option is to explicitly set the exec context.

Activity

  1. cgwalters commented on Jan 15, 2019

    @cgwalters
    MemberAuthor

    (This issue is an argument for rolling in at least some of the pivot functionality into rpm-ostreed itself)

  2. added a commit that references this issue on Jan 16, 2019
  3. jlebon commented on Jan 16, 2019

    @jlebon
    Member

    EDIT: Actually the problem is:

    I0115 21:55:07.102216   63098 run.go:14] Running: ostree pull-local srv/repo 9249e2dc8c0adf821ad4c43545900aa94b96216401a3d615799666454771dc03
    error: Writing content object: fsetxattr: Invalid argument
    

    I'm still confused why we're hitting this. /usr/bin/ostree is install_exec_t too, no?

  4. jlebon commented on Jan 16, 2019

    @jlebon
    Member

    Ahh I see, it's not transitioning to install_t because we're invoking from a container.

    Another option is to explicitly set the exec context.

    If that works, that'd be my preference over coreos/rpm-ostree#1732 given how specific the circumstances are.

  5. cgwalters commented on Jan 16, 2019

    @cgwalters
    MemberAuthor

    If that works, that'd be my preference over coreos/rpm-ostree#1732 given how specific the circumstances are.

    In order to make it work we'd have to mount selinuxfs...which would then cause other tools in the container to think SELinux is enabled, which probably wouldn't be a problem but still...an unknown impact.

    I think it's going to work best if we do SELinux related things on the host and keep our container more container-like.

    And more generally...I think we want to keep the model of having "host APIs" that live on the host where that makes sense, and the MCD drives them.

  6. jlebon commented on Jan 16, 2019

    @jlebon
    Member

    I think we want to keep the model of having "host APIs" that live on the host where that makes sense, and the MCD drives them

    Yeah that makes sense. This is also the root of the issue here. We're calling the host pivot from the container context. Hmm, how about something like this:

    rhcos-pivot.path

    [Unit]
    Description=Pivot Tool
    Documentation=man:ostree(1)
    
    [Path]
    PathExists=/run/pivot/foobar
    

    rhcos-pivot.service

    ...
    [Service]
    ExecStart=/usr/bin/pivot --from-file /run/pivot/foobar
    

    ?

  7. cgwalters commented on Jan 16, 2019

    @cgwalters
    MemberAuthor

    Which we want anyways, see 94d3783

  8. 5 remaining items

  9. changed the title [-]ootpa rebase fails due to SELinux `mac_admin`[/-] [+]rhel8 rebase fails due to SELinux `mac_admin`[/+] on Mar 12, 2019
  10. added a commit that references this issue on May 15, 2026
    980498d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions