Bug 2484542 - kmscon implementation breaks console initial-setup
Summary: kmscon implementation breaks console initial-setup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 45
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedBlocker
Depends On:
Blocks: BetaBlocker, F45BetaBlocker 2418795
TreeView+ depends on / blocked
 
Reported: 2026-06-03 20:31 UTC by Adam Williamson (Red Hat non-Fedora)
Modified: 2026-09-11 19:03 UTC (History)
17 users (show)

Fixed In Version: selinux-policy-45.15-2.fc46 selinux-policy-45.15-2.fc45 selinux-policy-45.16-1.fc45
Clone Of:
Environment:
Last Closed: 2026-09-05 16:18:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
HOWTO Install SELinux policy update on mounted fs (4.06 KB, text/plain)
2026-08-28 10:32 UTC, Jaroslav Groman
no flags Details
bootlog Fedora-Minimal-45_Beta-1.1.aarch64 (152.27 KB, text/plain)
2026-09-03 12:21 UTC, Jaroslav Groman
no flags Details
bootlog Fedora-Minimal-Rawhide-20260903.n.0.aarch64 (401.60 KB, text/plain)
2026-09-03 12:22 UTC, Jaroslav Groman
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 3396 0 None open Support console version of initial-setup 2026-09-01 20:00:09 UTC

Description Adam Williamson (Red Hat non-Fedora) 2026-06-03 20:31:34 UTC
When you deploy Fedora from the ARM minimal disk image, the first thing you should see on boot is the console version of initial-setup. However, since the kmscon Change landed recently, it does not appear; you boot straight to a (kmscon) login prompt, where you can't log in, because there are no user accounts and no root password.

This probably affects any other case where console initial-setup should appear as well, but the ARM minimal disk image case is probably the most important.

ARM minimal disk image is release-blocking per https://docs.fedoraproject.org/en-US/releases/f44/blocking/ , so proposing as a Beta blocker as a violation of https://fedoraproject.org/wiki/Basic_Release_Criteria#Expected_installed_system_boot_behavior , "A working mechanism to create a user account must be clearly presented during installation and/or first boot of the installed system."

The bug is likely not in kmscon itself, but filing against kmscon initially to ensure the right folks see it.

Comment 1 Jocelyn Falempe 2026-06-03 21:04:32 UTC
It should be possible to start kmscon with the initial-setup script as a login program.

Something like this may work:

systemctl stop kmsconvt@tty1
kmscon --vt=tty1 --no-switchvt --login -- initial-setup

Comment 2 Jocelyn Falempe 2026-06-11 15:35:15 UTC
I've added a --oneshot argument to kmscon, to help solve this issue:

https://github.com/kmscon/kmscon/pull/427

Comment 3 Jocelyn Falempe 2026-06-12 15:15:21 UTC
I've proposed the following PR to initial setup, that solve the issue.

https://github.com/rhinstaller/initial-setup/pull/161

This also require the --oneshot support in kmscon, and some selinux rules, as by default selinux will prevent kmscon to start initial-setup.

Comment 4 Adam Williamson (Red Hat non-Fedora) 2026-07-03 19:00:09 UTC
I see I didn't actually propose this as a Beta blocker, though I said I would...fixing.

Comment 5 Aoife Moloney 2026-08-17 14:45:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.

Comment 6 Lukas Ruzicka (Red Hat) 2026-08-24 19:04:08 UTC
  AGREED AcceptedBetaBlocker
  
  Discussed at the 2026-08-24 (blocker / freeze exception) review meeting:
  
  This is accepted as a violation of 'A working mechanism to create a user account must be clearly presented during installation and/or first boot of the installed system' for the ARM minimal disk image (which is release-blocking and relies on console initial-setup to provide said mechanism).
  
  https://meetbot-raw.fedoraproject.org//blocker-review_matrix_fedoraproject-org/2026-08-24/f45-blocker-review.2026-08-24-15.59.log.txt

Comment 7 Martin Kolman 2026-08-25 17:26:38 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=2358688#c32 & follow-up commits for a status updated about how it looks like with the Initial Setup TUI. Unfortunately, even the latest batch of fixes has not yet fully fixed this. :P

Comment 8 Jaroslav Groman 2026-08-26 14:26:36 UTC
I was able to sidestep kmscon + SELinux problems and run initial-setup on aarch64 / RPi4 by adding
this convoluted override suggested by Claude Opus 4.6. It runs initial-setup in text mode and switches
to kmscon after setup is done. Verified working on Minimal aarch64 image F45 Branched 20260826.n.0.

/etc/systemd/system/initial-setup.service.d/override.conf

[Unit]
# Stop kmscon on tty1 so it doesn't fight for the display
Conflicts=kmsconvt

[Service]
# Bypass kmscon which crashes on RPi4 due to V3D DRM incompatibility (SIGSEGV
# in kmscon_seat_remove_video). Run initial-setup TUI directly on tty1.
#
# Use --no-multi-tty because the multi-TTY handler opens every /dev/tty* and
# /dev/ttyS* device, which conflicts with kmscon instances on other VTs and
# results in the wizard output being invisible to the user. With --no-multi-tty
# the TUI reads/writes only on its own stdin/stdout (tty1).
#
# Use tty-force for StandardInput to ensure the TTY becomes the controlling
# terminal of the process (TIOCSCTTY). Without this, echo and line editing
# do not work because simpleline relies on Python's input() which needs a
# properly configured controlling terminal.
ExecStartPre=
ExecStart=
ExecStart=/bin/bash -c '\
    stty sane; \
    IS_UNIT=initial-setup.service; \
    /usr/libexec/initial-setup/initial-setup-text --no-stdout-log --no-multi-tty; \
    res=$?; \
    if [ $res -eq 0 ]; then \
        echo "Initial Setup finished successfully, disabling" | systemd-cat -t initial-setup -p 6; \
        systemctl -q is-enabled $IS_UNIT && systemctl disable $IS_UNIT; \
    else \
        echo "Initial Setup failed, keeping enabled" | systemd-cat -t initial-setup -p 3; \
    fi; \
    exit $res'
ExecStartPost=
ExecStartPost=/usr/bin/systemctl start --no-block kmsconvt
TTYPath=/dev/tty1
StandardInput=tty-force
StandardOutput=tty
StandardError=journal

Comment 9 Jaroslav Groman 2026-08-27 09:53:56 UTC
I also investigated kmscon+SELinux route:

The initial-setup TUI fails to start under SELinux enforcing mode when launched via kmscon due to two issues in selinux-policy:
1. Missing file context: The binaries in /usr/libexec/initial-setup/ have generic bin_t context instead of install_exec_t. 
   The policy defines install_exec_t for /usr/bin/initial-setup and /usr/bin/anaconda, but not for /usr/libexec/initial-setup/ 
   where the actual TUI binaries live.
2. Missing type transition: When kmscon (kmscon_t) spawns initial-setup via --login, there is no type_transition rule to move 
   the child process from kmscon_t to install_t. The policy defines this transition for init_t, unconfined_t, and several other
   domains, but not for kmscon_t.
As a result, initial-setup inherits the kmscon_t context and gets AVC denials for operations that install_t would normally be allowed (searching /etc/pki, executing /usr/sbin/ldconfig, accessing journal directories).

Fix verified on Minimal aarch64 image F45 Branched 20260826.n.0 with the following custom policy module:

module kmscon-initial-setup 1.1;

require {
    type kmscon_t;
    type install_t;
    type install_exec_t;
    class dir { search getattr open read };
    class file { execute open read getattr map ioctl };
    class process { transition };
}

allow kmscon_t install_exec_t:dir { search getattr open read };
allow kmscon_t install_exec_t:file { execute open read getattr map ioctl };
allow kmscon_t install_t:process transition;
type_transition kmscon_t install_exec_t:process install_t;

And the following file context addition:

/usr/libexec/initial-setup(/.*)?    --    system_u:object_r:install_exec_t:s0


With both applied, initial-setup runs as install_t and completes successfully with zero AVC denials.

There is a separate problem that on RPi4 kmscon crashes on shutdown when initial-setup is already done.
I reported this here including a fix: https://bugzilla.redhat.com/show_bug.cgi?id=2524448

Comment 10 Jaroslav Groman 2026-08-28 10:32:02 UTC
Created attachment 2155891 [details]
HOWTO Install SELinux policy update on mounted fs

Comment 11 Simon de Vlieger 2026-08-30 07:34:33 UTC
I've reassigned this issue to `selinux-policy` as this is an SELinux policy issue and the above policy change (I haven't looked if it's actually a "good" change) has been confirmed to resolve it.

Comment 12 Simon de Vlieger 2026-08-30 07:38:25 UTC
Some concerns I have with the suggested policy:

1. I think the install_exec_t:dir is a dead rule.
2. This basically allows kmscon to do *everything*.

But I think that's already the status quo anyways.

Comment 13 Jaroslav Groman 2026-08-31 08:31:51 UTC
If the SELinux update is too intrusive, there is another verified workaround described in https://bugzilla.redhat.com/show_bug.cgi?id=2484542#c8
This one temporarily drops kmscon from tty1, runs initial-setup there in text mode and restores kmscon after it is done.
Only initial-setup service needs to be updated, no changes to SELinux configuration.

Comment 14 Adam Williamson (Red Hat non-Fedora) 2026-08-31 17:02:04 UTC
Zdenek, can you please take a look at this and let us know what you think? It's a Fedora 45 Beta blocker and Beta is coming up soon, so we really need some kind of resolution.

Comment 15 Jocelyn Falempe 2026-09-01 09:11:11 UTC
(In reply to Simon de Vlieger from comment #12)
> Some concerns I have with the suggested policy:
> 
> 1. I think the install_exec_t:dir is a dead rule.
> 2. This basically allows kmscon to do *everything*.
> 
> But I think that's already the status quo anyways.

Is that still better than fbcon, that is in the kernel so is completely out of the selinux policy ?

Comment 16 Zdenek Pytela 2026-09-01 13:47:10 UTC
Taking a look, I'll comment later today.

Comment 17 Zdenek Pytela 2026-09-01 20:00:10 UTC
I think a fix is needed in selinux-policy.

Comment 18 Adam Williamson (Fedora) 2026-09-02 19:06:07 UTC
Thanks, Zdenek. Can we expect a new build with the fix soon? Go/No-Go for Beta is next week, I am trying to line up blocker fixes as early as possible. Thanks again!

Comment 19 Adam Williamson (Fedora) 2026-09-02 21:21:31 UTC
Actually, since this is the last blocker for Beta currently, I'll do a backport build...

Comment 20 Fedora Update System 2026-09-02 21:35:26 UTC
FEDORA-2026-a24762e6fe (selinux-policy-45.15-2.fc46) has been submitted as an update to Fedora 46.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-a24762e6fe

Comment 21 Fedora Update System 2026-09-02 21:50:02 UTC
FEDORA-2026-2f1cf4178d (selinux-policy-45.15-2.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-2f1cf4178d

Comment 22 Fedora Update System 2026-09-02 22:52:38 UTC
FEDORA-2026-a24762e6fe (selinux-policy-45.15-2.fc46) has been pushed to the Fedora 46 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 23 Adam Williamson (Fedora) 2026-09-03 00:04:45 UTC
Setting back to ON_QA, the Rawhide update cannot close this bug.

Comment 24 Fedora Update System 2026-09-03 02:13:37 UTC
FEDORA-2026-2f1cf4178d has been pushed to the Fedora 45 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-2f1cf4178d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-2f1cf4178d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 25 Efraim Kaov 2026-09-03 11:54:42 UTC
Seems that `initial-setup` is not fixed in F45 Beta 1.1 for either aarch64 or x86_64

Comment 26 Jaroslav Groman 2026-09-03 12:20:56 UTC
Seems that SELinux policy update did not make it yet to this release - see AVC denials in attached boot log.
Including also latest Rawhide boot log for comparing.

Comment 27 Jaroslav Groman 2026-09-03 12:21:39 UTC
Created attachment 2156576 [details]
bootlog Fedora-Minimal-45_Beta-1.1.aarch64

Comment 28 Jaroslav Groman 2026-09-03 12:22:43 UTC
Created attachment 2156577 [details]
bootlog Fedora-Minimal-Rawhide-20260903.n.0.aarch64

Comment 29 Efraim Kaov 2026-09-03 13:48:28 UTC
After I updated manually selinux-policy* from version 45.14.1.fc45 to 45.15-2.fc45 the initial-setup works as expected on Fedora 45 Beta 1.1.

Comment 30 Adam Williamson (Fedora) 2026-09-03 15:49:08 UTC
Yeah, sorry, my bad. I meant to include the selinux-policy fix - that's why I made it! - but somehow it didn't make it into the Beta-1.1 request. I've requested a new candidate compose now.

Comment 31 Adam Williamson (Fedora) 2026-09-04 01:11:35 UTC
Fix verified in Beta-1.2 testing.

Comment 32 Fedora Update System 2026-09-05 16:18:01 UTC
FEDORA-2026-2f1cf4178d (selinux-policy-45.15-2.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 33 Fedora Update System 2026-09-08 10:32:31 UTC
FEDORA-2026-c59e65cdbc (selinux-policy-45.16-1.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-c59e65cdbc

Comment 34 Fedora Update System 2026-09-09 00:54:26 UTC
FEDORA-2026-c59e65cdbc has been pushed to the Fedora 45 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-c59e65cdbc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-c59e65cdbc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 35 Fedora Update System 2026-09-11 19:03:37 UTC
FEDORA-2026-c59e65cdbc (selinux-policy-45.16-1.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.


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