Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temporary workaround for agetty --reload SELinux denial #988

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Apr 29, 2021

In f34+, we're hitting an SELinux denial from c-l-h-m trying to do
agetty --reload and causing /run/agetty.reload to be created with
the wrong label. This then prevents agetty from adding an inotify watch
to know when to reload the prompt to display new information. For more
details, see:

#859 (comment)

This is tracked at https://bugzilla.redhat.com/show_bug.cgi?id=1932053.

With this workaround, we create the file up front in the initrd so that
it gets relabeled by systemd on switchroot and thus will already exists
with the right label well before c-l-h-m or anything else tries to
agetty --reload.

@jlebon
Copy link
Member Author

jlebon commented Apr 29, 2021

Still need to test this.

@jlebon
Copy link
Member Author

jlebon commented Apr 29, 2021

Once we get this in, we can drop the way hackier workaround in rawhide that was added in #859.

@dustymabe
Copy link
Member

would dropping a stub ignition config that creates the file work too? I think files that get laid down by ignition get relabeled by default.

@jlebon
Copy link
Member Author

jlebon commented Apr 29, 2021

would dropping a stub ignition config that creates the file work too? I think files that get laid down by ignition get relabeled by default.

Ignition configs can't write to /run.

In f34+, we're hitting an SELinux denial from c-l-h-m trying to do
`agetty --reload` and causing `/run/agetty.reload` to be created with
the wrong label. This then prevents agetty from adding an inotify watch
to know when to reload the prompt to display new information. For more
details, see:

coreos#859 (comment)

This is tracked at https://bugzilla.redhat.com/show_bug.cgi?id=1932053.

With this workaround, we create the file up front in the initrd so that
it gets relabeled by systemd on switchroot and thus will already exists
with the right label well before c-l-h-m or anything else tries to
`agetty --reload`.
@jlebon jlebon force-pushed the pr/agetty-workaround branch from 5d8569d to 316971c Compare April 29, 2021 14:13
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM: It would be nice if we bake in some sort of reminder to go back and remove this.

@jlebon
Copy link
Member Author

jlebon commented Apr 29, 2021

LGTM: It would be nice if we bake in some sort of reminder to go back and remove this.

Heh yeah, this is what this comment is about:

TODO f34: check if we can drop this whole module

(See coreos/fedora-coreos-tracker#704 (comment)). We can bump it to f35 when we're rebasing testing if it's still not fixed.

@jlebon jlebon marked this pull request as ready for review April 29, 2021 16:46
@jlebon
Copy link
Member Author

jlebon commented Apr 29, 2021

Tested working!

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dustymabe dustymabe merged commit af44cb3 into coreos:testing-devel Apr 29, 2021
jlebon added a commit to jlebon/fedora-coreos-config that referenced this pull request Apr 29, 2021
This reverts commit f8b31ab.

This is done a cleaner way now in
coreos#988.
jlebon added a commit that referenced this pull request Apr 30, 2021
This reverts commit f8b31ab.

This is done a cleaner way now in
#988.
c4rt0 pushed a commit to c4rt0/fedora-coreos-config that referenced this pull request Mar 27, 2023
extensions: use stream9 as builder because of s390x
@jlebon jlebon deleted the pr/agetty-workaround branch April 23, 2023 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants