Bug 2290482 - No tty on serial console with selinux-policy-40.21-1.fc41 and later
Summary: No tty on serial console with selinux-policy-40.21-1.fc41 and later
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 40
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: openqa
: 2296652 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-06-04 22:17 UTC by Adam Williamson
Modified: 2024-08-11 04:49 UTC (History)
19 users (show)

Fixed In Version: selinux-policy-40.27-1.fc40
Clone Of:
Environment:
Last Closed: 2024-08-11 04:49:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
output of boot from starfive VF2 serial uart connection does not display login prompt after installing lastest f41 kernel (81.20 KB, text/plain)
2024-07-04 12:33 UTC, David Marceau
no flags Details
my relabel of the sdcard before rebooting (13.10 KB, text/plain)
2024-07-05 03:47 UTC, David Marceau
no flags Details
output from the bootup after the relabel completed successfully (143.15 KB, text/plain)
2024-07-05 03:50 UTC, David Marceau
no flags Details
Output of `journalctl -b 0 --grep avc --no-pager` on selinux-policy-41.7-1.fc41 (19.70 KB, text/plain)
2024-07-09 20:06 UTC, Jonathan Lebon
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 2147 0 None Merged systemd policy updates 2024-06-05 14:05:18 UTC

Description Adam Williamson 2024-06-04 22:17:30 UTC
The openQA serial console install test started failing in Fedora-Rawhide-20240601.n.0. This turns out to be an SELinux policy issue.

In the openQA test, we run a VM with these args:

/usr/bin/qemu-system-x86_64 -device virtio-vga,edid=on,xres=1024,yres=768 -only-migratable -chardev ringbuf,id=serial0,logfile=serial0,logappend=on -serial chardev:serial0 -audiodev none,id=snd0 -device intel-hda -device hda-output,audiodev=snd0 -global isa-fdc.fdtypeA=none -m 3072 -machine q35,smm=on -cpu Nehalem -netdev user,id=qanet0,net=172.16.2.0/24 -device virtio-net,netdev=qanet0,mac=52:54:00:12:34:56 -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 -device qemu-xhci -device usb-tablet -smp 2 -enable-kvm -no-shutdown -vnc :113,share=force-shared -device virtio-serial -chardev pipe,id=virtio_console,path=virtio_console,logfile=virtio_console.log,logappend=on -device virtconsole,chardev=virtio_console,name=org.openqa.console.virtio_console -chardev pipe,id=virtio_console_user,path=virtio_console_user,logfile=virtio_console_user.log,logappend=on -device virtconsole,chardev=virtio_console_user,name=org.openqa.console.virtio_console_user -chardev pipe,id=virtio_console1,path=virtio_console1,logfile=virtio_console1.log,logappend=on -device virtconsole,chardev=virtio_console1,name=org.openqa.console.virtio_console1 -chardev socket,path=qmp_socket,server=on,wait=off,id=qmp_socket,logfile=qmp_socket.log,logappend=on -qmp chardev:qmp_socket -S -global driver=cfi.pflash01,property=secure,value=on -device virtio-scsi-pci,id=scsi0 -blockdev driver=file,node-name=hd0-file,filename=/var/lib/openqa/pool/23/raid/hd0,cache.no-flush=on -blockdev driver=qcow2,node-name=hd0,file=hd0-file,cache.no-flush=on,discard=unmap -device virtio-blk,id=hd0-device,drive=hd0,serial=hd0 -blockdev driver=file,node-name=cd0-overlay0-file,filename=/var/lib/openqa/pool/23/raid/cd0-overlay0,cache.no-flush=on -blockdev driver=qcow2,node-name=cd0-overlay0,file=cd0-overlay0-file,cache.no-flush=on,discard=unmap -device scsi-cd,id=cd0-device,drive=cd0-overlay0,serial=cd0 -drive id=pflash-code-overlay0,if=pflash,file=/var/lib/openqa/pool/23/raid/pflash-code-overlay0,unit=0,readonly=on -drive id=pflash-vars-overlay0,if=pflash,file=/var/lib/openqa/pool/23/raid/pflash-vars-overlay0,unit=1

That winds up running a VM with, I think, four serial consoles, and the naming gets very confusing between what openQA thinks of them as being internally, what they're called in the qemu commands, what their device nodes are, and what the log files are called. But more or less, we run the install with `inst.text console=hvc1` and after the install we expect to see a login prompt on the terminal hvc1 , but there isn't one. There is a login prompt on hvc0 , but not on hvc1. Up until the 20240601.n.0 compose (which included selinux-policy-40.21-1.fc41), there always was.

If we boot with `enforcing=0`, the prompt does appear on hvc1. So this is definitely an SELinux issue.

Looking at the journal, I see all these denials:

Jun 04 02:44:14 localhost kernel: audit: type=1400 audit(1717494254.271:7): avc:  denied  { setfscreate } for  pid=522 comm="systemd-getty-g" scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=process permissive=0
Jun 04 02:44:14 localhost kernel: audit: type=1400 audit(1717494254.271:8): avc:  denied  { setfscreate } for  pid=522 comm="systemd-getty-g" scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=process permissive=0
Jun 04 02:44:14 localhost kernel: audit: type=1400 audit(1717494254.271:9): avc:  denied  { setfscreate } for  pid=522 comm="systemd-getty-g" scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=process permissive=0
Jun 04 02:44:14 localhost kernel: audit: type=1400 audit(1717494254.271:10): avc:  denied  { setfscreate } for  pid=522 comm="systemd-getty-g" scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=process permissive=0
Jun 04 02:44:15 localhost kernel: audit: type=1400 audit(1717494255.089:15): avc:  denied  { sendto } for  pid=570 comm="systemd-hwdb" path="/systemd/journal/socket" scontext=system_u:system_r:systemd_hwdb_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=unix_dgram_socket permissive=0
Jun 04 02:44:15 localhost kernel: audit: type=1400 audit(1717494255.089:16): avc:  denied  { write } for  pid=570 comm="systemd-hwdb" name="kmsg" dev="devtmpfs" ino=10 scontext=system_u:system_r:systemd_hwdb_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file permissive=0
Jun 04 02:44:15 localhost audit[570]: AVC avc:  denied  { sendto } for  pid=570 comm="systemd-hwdb" path="/systemd/journal/socket" scontext=system_u:system_r:systemd_hwdb_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=unix_dgram_socket permissive=0
Jun 04 02:44:15 localhost audit[570]: AVC avc:  denied  { write } for  pid=570 comm="systemd-hwdb" name="kmsg" dev="devtmpfs" ino=10 scontext=system_u:system_r:systemd_hwdb_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file permissive=0
Jun 04 02:44:15 localhost audit[576]: AVC avc:  denied  { write } for  pid=576 comm="systemd-nsresou" name="memory.pressure" dev="cgroup2" ino=2767 scontext=system_u:system_r:systemd_nsresourced_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=file permissive=1
Jun 04 02:44:17 localhost audit[695]: AVC avc:  denied  { connectto } for  pid=695 comm="(emd-oomd)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:17 localhost audit[696]: AVC avc:  denied  { connectto } for  pid=696 comm="(resolved)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:17 localhost audit[765]: AVC avc:  denied  { connectto } for  pid=765 comm="(polkitd)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:18 localhost audit[805]: AVC avc:  denied  { connectto } for  pid=805 comm="abrtd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:18 localhost audit[805]: AVC avc:  denied  { connectto } for  pid=805 comm="abrtd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="(leshootd)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[730]: AVC avc:  denied  { connectto } for  pid=730 comm="auditd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[730]: AVC avc:  denied  { connectto } for  pid=730 comm="auditd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:20 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:20 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:03 localhost.localdomain audit[936]: AVC avc:  denied  { connectto } for  pid=936 comm="login" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:03 localhost.localdomain audit[936]: AVC avc:  denied  { connectto } for  pid=936 comm="login" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:04 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="(leshootd)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:05 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:05 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:05 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:05 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0

Comment 1 Adam Williamson 2024-06-04 22:18:47 UTC
`-chardev pipe,id=virtio_console_user,path=virtio_console_user,logfile=virtio_console_user.log,logappend=on -device virtconsole,chardev=virtio_console_user,name=org.openqa.console.virtio_console_user` is the console that winds up being hvc1, I think, but I don't think it matters a lot.

Comment 2 Zdenek Pytela 2024-06-05 14:03:23 UTC
Going to fix the generator issue which is a regresion.
hwdb issue is an effect of the new systemd and is already addressed.
nsresourced is under investigation.

Comment 3 Adam Williamson 2024-06-10 22:01:38 UTC
This is not fully fixed in selinux-policy-41.2-1.fc41 . Still no console, and these denials (not all related to this bug, probably, but listing them all for completeness):

Jun 04 02:44:14 localhost kernel: audit: type=1400 audit(1717494254.271:7): avc:  denied  { setfscreate } for  pid=522 comm="systemd-getty-g" scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=process permissive=0
Jun 04 02:44:14 localhost kernel: audit: type=1400 audit(1717494254.271:8): avc:  denied  { setfscreate } for  pid=522 comm="systemd-getty-g" scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=process permissive=0
Jun 04 02:44:14 localhost kernel: audit: type=1400 audit(1717494254.271:9): avc:  denied  { setfscreate } for  pid=522 comm="systemd-getty-g" scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=process permissive=0
Jun 04 02:44:14 localhost kernel: audit: type=1400 audit(1717494254.271:10): avc:  denied  { setfscreate } for  pid=522 comm="systemd-getty-g" scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=process permissive=0
Jun 04 02:44:15 localhost kernel: audit: type=1400 audit(1717494255.089:15): avc:  denied  { sendto } for  pid=570 comm="systemd-hwdb" path="/systemd/journal/socket" scontext=system_u:system_r:systemd_hwdb_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=unix_dgram_socket permissive=0
Jun 04 02:44:15 localhost kernel: audit: type=1400 audit(1717494255.089:16): avc:  denied  { write } for  pid=570 comm="systemd-hwdb" name="kmsg" dev="devtmpfs" ino=10 scontext=system_u:system_r:systemd_hwdb_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file permissive=0
Jun 04 02:44:15 localhost audit[570]: AVC avc:  denied  { sendto } for  pid=570 comm="systemd-hwdb" path="/systemd/journal/socket" scontext=system_u:system_r:systemd_hwdb_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=unix_dgram_socket permissive=0
Jun 04 02:44:15 localhost audit[570]: AVC avc:  denied  { write } for  pid=570 comm="systemd-hwdb" name="kmsg" dev="devtmpfs" ino=10 scontext=system_u:system_r:systemd_hwdb_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file permissive=0
Jun 04 02:44:15 localhost audit[576]: AVC avc:  denied  { write } for  pid=576 comm="systemd-nsresou" name="memory.pressure" dev="cgroup2" ino=2767 scontext=system_u:system_r:systemd_nsresourced_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=file permissive=1
Jun 04 02:44:17 localhost audit[695]: AVC avc:  denied  { connectto } for  pid=695 comm="(emd-oomd)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:17 localhost audit[696]: AVC avc:  denied  { connectto } for  pid=696 comm="(resolved)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:17 localhost audit[765]: AVC avc:  denied  { connectto } for  pid=765 comm="(polkitd)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:18 localhost audit[805]: AVC avc:  denied  { connectto } for  pid=805 comm="abrtd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:18 localhost audit[805]: AVC avc:  denied  { connectto } for  pid=805 comm="abrtd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="(leshootd)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[730]: AVC avc:  denied  { connectto } for  pid=730 comm="auditd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:19 localhost.localdomain audit[730]: AVC avc:  denied  { connectto } for  pid=730 comm="auditd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:20 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:44:20 localhost.localdomain audit[854]: AVC avc:  denied  { connectto } for  pid=854 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:03 localhost.localdomain audit[936]: AVC avc:  denied  { connectto } for  pid=936 comm="login" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:03 localhost.localdomain audit[936]: AVC avc:  denied  { connectto } for  pid=936 comm="login" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:04 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="(leshootd)" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:05 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:05 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:05 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0
Jun 04 02:49:05 localhost.localdomain audit[1086]: AVC avc:  denied  { connectto } for  pid=1086 comm="setroubleshootd" path="/run/systemd/io.systemd.NamespaceResource" scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:system_r:systemd_nsresourced_t:s0 tclass=unix_stream_socket permissive=0

Comment 4 Jason Montleon 2024-06-12 23:32:36 UTC
I lost the login prompt on serial console with update to selinux-policy-40.22-1.fc40.noarch

sudo dnf downgrade selinux-policy-targeted gives me selinux-policy-targeted-40.20-1.fc40.noarch which works fine.

Comment 5 Jason Montleon 2024-06-20 20:30:03 UTC
Installing selinux-policy-40.23-1.fc40 and rebooting does not fix this, at least for me. The generator is still broken.

If I use audit2allow on these denials the resulting module allows the generator to work.
May 27 00:00:19 audit[1301]: AVC avc:  denied  { net_admin } for  pid=1301 comm="systemd-user-ru" capability=12  scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:system_r:systemd_logind_t:s0 tclass=capability permissive=1
type=AVC msg=audit(1718912889.274:568): avc:  denied  { search } for  pid=1430 comm="systemd-getty-g" name="1" dev="proc" ino=283 scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1718912889.274:569): avc:  denied  { search } for  pid=1430 comm="systemd-getty-g" name="1" dev="proc" ino=283 scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1718912889.274:570): avc:  denied  { net_admin } for  pid=1430 comm="systemd-getty-g" capability=12  scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:systemd_getty_generator_t:s0 tclass=capability permissive=0
type=AVC msg=audit(1718912889.275:571): avc:  denied  { search } for  pid=1430 comm="systemd-getty-g" name="1" dev="proc" ino=283 scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1718912889.275:572): avc:  denied  { read write } for  pid=1430 comm="systemd-getty-g" name="ttyAMA10" dev="devtmpfs" ino=2 scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1718913666.811:560): avc:  denied  { read } for  pid=1474 comm="systemd-getty-g" name="cgroup" dev="proc" ino=5509 scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file permissive=0
type=AVC msg=audit(1718913666.818:561): avc:  denied  { read } for  pid=1474 comm="systemd-getty-g" name="environ" dev="proc" ino=5682 scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file permissive=0
type=AVC msg=audit(1718913666.818:562): avc:  denied  { read } for  pid=1474 comm="systemd-getty-g" name="environ" dev="proc" ino=5682 scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file permissive=0
type=AVC msg=audit(1718913666.818:563): avc:  denied  { ioctl } for  pid=1474 comm="systemd-getty-g" path="/dev/ttyAMA10" dev="devtmpfs" ino=2 ioctlcmd=0x5401 scontext=system_u:system_r:systemd_getty_generator_t:s0 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file permissive=0

The first only shows in the journal if I am in permssive mode. I guess it happens too early to be picked up in audit.log. The rest are from audit.log. 

I can alternatively manually enable serial-getty

Comment 6 Peter Robinson 2024-06-20 21:08:53 UTC
I'm seeing the same issue on F-40 with a number of different arm devices.

Comment 7 Rob Foehl 2024-06-21 18:15:20 UTC
Same on several VMs and machines with serial-attached IPMI consoles (all x86_64), although none of those cases emits any audit log entries.  Was scratching my head quite a bit before seeing the fedora-devel posts referencing this bug, especially since manually starting serial-getty@ttySx works fine.

Comment 8 Jason Montleon 2024-07-04 12:14:16 UTC
I am still encountering this testing with Fedora 41 selinux-policy.

Comment 9 Peter Robinson 2024-07-04 12:31:04 UTC
(In reply to Jason Montleon from comment #8)
> I am still encountering this testing with Fedora 41 selinux-policy.

So am I

Comment 10 Fedora Blocker Bugs Application 2024-07-04 12:31:54 UTC
Proposed as a Blocker for 41-beta by Fedora user pbrobinson using the blocker tracking app because:

 Need to be able to login on all supported mechanisms.

Comment 11 David Marceau 2024-07-04 12:33:25 UTC
Created attachment 2038995 [details]
output of boot from starfive VF2 serial uart connection does not display login prompt after installing lastest f41 kernel

You are all SUPER-HEROES!

I just wanted to capture the starfive VisionFive 2 serial uart output displaying the boot output.
NOTE:  I can acknowledge there is not tty on the serial console.

Kernel 6.10.0-0.rc6.20240702git1dfe225e9af5.51.0.riscv64.fc41.riscv64 on an riscv64 (ttyS0)

I can also acknowledge adding enforcing=0 in the linux boot parameters and then enabling the serial getty service then rebooting gave me back the login prompt for the interim.
sudo systemctl enable --now serial-getty@ttyS0

Comment 12 David Marceau 2024-07-04 12:49:31 UTC
Jason's VF2 6.9'ish kernel repo in association with koji f40 repo was ok for the serial terminal login.  I lost my serial terminal login after changing koji repo from f40 to f41, it upgraded not only the kernel, but all the f40 packages to f41 using davidlt's newer kernel 6.10.0-0rc6

This is Jason's repo in case you want a last known good for the vf2..

[vf2-lpi4a]
name=vf2-lpi4a
enabled=1
gpgcheck=0
baseurl=https://people.redhat.com/jmontleo/fedora/linux/releases/40/vf2-lpi4a/riscv64/

[vf2-lpi4a-source]
name=vf2-lpi4a-source
enabled=0
gpgcheck=0
baseurl=https://people.redhat.com/jmontleo/fedora/linux/releases/40/vf2-lpi4a/source/tree

Comment 13 Steve 2024-07-04 20:51:40 UTC
(In reply to David Marceau from comment #11)
> Created attachment 2038995 [details]
> output of boot from starfive VF2 serial uart connection does not display login prompt after installing lastest f41 kernel

You have three AVCs in that attachment. This is the first one:

[   14.134067] audit: type=1400 audit(1719878409.335:4): avc:  denied  { getattr } for  pid=425 comm="systemd-fstab-g" path="/boot" dev="mmcblk1p5" ino=258 scontext=system_u:system_r:systemd_fstab_generator_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0

You might try relabeling:

# fixfiles onboot

or

# touch /.autorelabel

Doc: fixfiles (8)         - fix file SELinux security contexts.

Comment 14 Steve 2024-07-04 21:46:51 UTC
(In reply to David Marceau from comment #11)
> Created attachment 2038995 [details]
> output of boot from starfive VF2 serial uart connection does not display login prompt after installing lastest f41 kernel

[    3.193361] 10000000.serial: ttyS0 at MMIO 0x10000000 (irq = 20, base_baud = 1500000) is a 16550A

That attachment doesn't show whether the systemd serial-getty is running. Try this:

$ systemctl status serial-getty

Comment 15 David Marceau 2024-07-05 03:47:14 UTC
Created attachment 2039055 [details]
my relabel of the sdcard before rebooting

this is the just the output of what I could capture of the relabel of the sdcard before it rebooted.

Comment 16 David Marceau 2024-07-05 03:50:05 UTC
Created attachment 2039056 [details]
output from the bootup after the relabel completed successfully

The attached file holds the output from the journalctl -b
after the relabel completed successfully and rebooted.

Comment 17 David Marceau 2024-07-05 03:53:12 UTC
(In reply to Steve from comment #14)
> (In reply to David Marceau from comment #11)
> > Created attachment 2038995 [details]
> > output of boot from starfive VF2 serial uart connection does not display login prompt after installing lastest f41 kernel
> 
> [    3.193361] 10000000.serial: ttyS0 at MMIO 0x10000000 (irq = 20,
> base_baud = 1500000) is a 16550A
> 
> That attachment doesn't show whether the systemd serial-getty
> is running. Try this:
> 
> $ systemctl status serial-getty

After the relabeling and the reboot, I did as you requested.

[riscv@fedora-riscv ~]$ sudo systemctl status serial-getty
[sudo] password for riscv: 
● serial-getty - Serial Getty on ttyS0
     Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Thu 2024-07-04 23:33:48 EDT; 17min ago
 Invocation: 76b4ac92e66e487480b48d08ac77fedd
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html
   Main PID: 806 (agetty)
      Tasks: 1 (limit: 9453)
     Memory: 328K (peak: 6.5M)
        CPU: 96ms
     CGroup: /system.slice/system-serial\x2dgetty.slice/serial-getty
             └─806 /sbin/agetty -o "-p -- \\u" --keep-baud 115200,57600,38400,9600 - vt220

Jul 04 23:33:48 fedora-riscv systemd[1]: serial-getty: Scheduled restart job, restart counter is at 1.
Jul 04 23:33:48 fedora-riscv systemd[1]: Started serial-getty - Serial Getty on ttyS0.
[riscv@fedora-riscv ~]$

Comment 18 Steve 2024-07-05 05:45:31 UTC
Thanks for the (In reply to David Marceau from comment #16)
> Created attachment 2039056 [details] output from the bootup after the relabel completed successfully
> The attached file holds the output from the journalctl -b after the relabel completed successfully and rebooted.

Thanks for the update.

The AVCs have been cleared, serial-getty is starting normally, and you were able to login on ttyS0:

Jul 04 23:30:13 fedora-riscv login[707]: DIALUP AT ttyS0 BY root
Jul 04 23:30:13 fedora-riscv login[707]: ROOT LOGIN ON ttyS0

However, the log does not show the "Kernel command line" for the boot after relabeling, and the "enforcing=" record is missing.

Did you boot with selinux enforcing enabled?

$ getenforce

Comment 19 Steve 2024-07-05 06:22:34 UTC
selinux-policy-41.7-1.fc41 could address some of the problems being reported here:
https://koji.fedoraproject.org/koji/packageinfo?packageID=32

Comment 20 Steve 2024-07-05 07:22:15 UTC
(In reply to Steve from comment #19)
> selinux-policy-41.7-1.fc41 could address some of the problems being reported here:
> https://koji.fedoraproject.org/koji/packageinfo?packageID=32

That hasn't been pushed, because it failed a lot of tests:
https://bodhi.fedoraproject.org/updates/FEDORA-2024-64134f8805

However, I have been testing it with F41 Workstation in a VM.

Connecting to ttyS0 with the "virsh" "console" command works as expected.

To test, download selinux-policy and selinux-policy-targeted from Koji:
https://koji.fedoraproject.org/koji/buildinfo?buildID=2480699

Install with:
$ sudo dnf install ./selinux*.rpm

Comment 21 Adam Williamson 2024-07-05 15:10:46 UTC
Huh, looks like I missed that update failing tests, probably because it landed during a long weekend here. It's failing tests because it breaks Apache (and hence FreeIPA). https://bodhi.fedoraproject.org/updates/FEDORA-2024-64134f8805#comment-3600824

Comment 22 Peter Robinson 2024-07-05 22:29:01 UTC
selinux-policy-40.23-1.fc40 with a relabel doesn't seem to fix it on a RPi4, I will test on some other devices.

Can someone reference the upstream commit that fixed it so I can possibly debug some more?

Comment 23 Steve 2024-07-05 22:41:29 UTC
Upstream is here, but we won't know if this bug is fixed with selinux-policy-41.7-1 until it is tested by users with real serial ports (as opposed to ones in a VM):

https://github.com/fedora-selinux/selinux-policy

See the changelog too:

https://koji.fedoraproject.org/koji/buildinfo?buildID=2480699

Comment 24 Steve 2024-07-05 23:40:05 UTC
With an F40 Server in a VM and connected with "virsh console", there are no serious problems:

$ tty
/dev/ttyS0

$ sudo ausearch -i -ts boot -m avc
<no matches>

There are, however, these log messages:

$ journalctl --no-hostname -b -g credentials
Jul 05 16:12:04 agetty[751]: failed to open credentials directory
Jul 05 16:12:04 agetty[752]: failed to open credentials directory

$ rpm -q selinux-policy
selinux-policy-40.23-1.fc40.noarch

$ rpm -qf /usr/sbin/agetty
util-linux-core-2.40.1-1.fc40.x86_64

$ uname -r
6.9.7-200.fc40.x86_64

Comment 25 Peter Robinson 2024-07-05 23:42:14 UTC
> https://github.com/fedora-selinux/selinux-policy

I meant what was the PR that apparently fixed this bug?

Comment 26 Steve 2024-07-05 23:49:43 UTC
(In reply to Peter Robinson from comment #25)
> > https://github.com/fedora-selinux/selinux-policy
> 
> I meant what was the PR that apparently fixed this bug?

We don't know that this bug is fixed on bare metal.

In a VM, the serial port works fine.

What do you show for these?

$ sudo ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts boot

$ journalctl --no-hostname -b -g credentials

(I'm assuming that ssh is working.)

Comment 27 Steve 2024-07-05 23:57:00 UTC
(In reply to Steve from comment #26)
> $ journalctl --no-hostname -b -g credentials

This is a better diagnostic:

$ systemctl status serial-getty

Comment 28 Steve 2024-07-06 00:27:49 UTC
(In reply to Peter Robinson from comment #25)
> I meant what was the PR that apparently fixed this bug?

If you are asking what is the latest released version of selinux-policy, you can find it listed here:
https://bodhi.fedoraproject.org/updates/?packages=selinux-policy

For F40, "dnf update" should get it.

For 41, you have to use the manual process described in Comment 20.

Comment 30 Jason Montleon 2024-07-06 03:51:10 UTC
I am using the latest Fedora 40 package and I still have this issue. I've tried a relabel with no change.

$ rpm -q selinux-policy selinux-policy-targeted
selinux-policy-40.23-1.fc40.noarch
selinux-policy-targeted-40.23-1.fc40.noarch

I have already mentioned most of this in https://bugzilla.redhat.com/show_bug.cgi?id=2290482#c5 but:

You need to run `semodule -DB`, reboot, and look in the journal to see the first denials.
ausearch won't show them. I have attached output with denials from my journal. You'll see denials for fstab, zram, bless_boot, and getty generators. The start of the getty issues are here. If you add a module to fix the getty generator denial you'll start seeing errors in audit.log that present later in boot.

You can boot with enforcing=0, or manually enable the getty with systemctl enable --now serial-getty@tty... but one should not have to do either of these.

Comment 31 Steve 2024-07-06 05:24:16 UTC
(In reply to Jason Montleon from comment #30)
...
> You need to run `semodule -DB`, reboot, and look in the journal to see the first denials.
> ausearch won't show them.
...

Thanks for the tips. Apparently the kernel logs denials before auditd starts running.

However, in an F40 Workstation VM with selinux-policy-41.7-1.fc41.noarch, there are very few of those:

$ journalctl --no-hostname -b | fgrep avc
Jul 05 22:10:08 kernel: audit: type=1400 audit(1720242608.182:7): avc:  denied  { write } for  pid=510 comm="systemd-integri" name="kmsg" dev="devtmpfs" ino=10 scontext=system_u:system_r:systemd_generic_generator_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file permissive=1
Jul 05 22:10:08 kernel: audit: type=1400 audit(1720242608.182:8): avc:  denied  { open } for  pid=510 comm="systemd-integri" path="/dev/kmsg" dev="devtmpfs" ino=10 scontext=system_u:system_r:systemd_generic_generator_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file permissive=1
Jul 05 22:10:08 kernel: audit: type=1400 audit(1720242608.194:9): avc:  denied  { write } for  pid=504 comm="systemd-cryptse" name="kmsg" dev="devtmpfs" ino=10 scontext=system_u:system_r:systemd_cryptsetup_generator_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file permissive=0
Jul 05 22:10:08 kernel: audit: type=1400 audit(1720242608.468:10): avc:  denied  { write } for  pid=544 comm="systemd-journal" name="memory.pressure" dev="cgroup2" ino=2041 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=file permissive=0
...

Comment 32 Steve 2024-07-06 05:45:05 UTC
(In reply to Steve from comment #31)
...
> However, in an F40 Workstation VM with selinux-policy-41.7-1.fc41.noarch, there are very few of those:
...

And ttyS0 is running and functional after booting:

$ systemctl -q list-units serial-getty
  serial-getty loaded active running Serial Getty on ttyS0

So I suggest installing selinux-policy-41.7-1.fc41.noarch on an F40 system per Comment 20.

Comment 33 Rob Foehl 2024-07-06 07:44:26 UTC
(In reply to Peter Robinson from comment #25)
> > https://github.com/fedora-selinux/selinux-policy
> 
> I meant what was the PR that apparently fixed this bug?

There isn't one, nor any reason to believe there is.

Just one confused individual celebrating success at booting a system with enforcing=0 and a manually enabled getty (comment 11), and another incessantly spamming this bug with completely irrelevant noise.

Meanwhile, the "maintainer" is pulling the usual routine of playing AVC whack-a-mole, claiming to have fixed something after one attempt, and ghosting the bug thereafter, ignoring all further evidence to the contrary.  There's no reason to believe this is going to improve, either.

Comment 34 Steve 2024-07-06 15:54:04 UTC
(In reply to Rob Foehl from comment #33)

Please see section 4 of the Red Hat Terms of Use:
https://www.redhat.com/en/about/terms-use

Comment 35 Jason Montleon 2024-07-06 17:34:11 UTC
I tried selinux-policy-41.7-1.fc41

It does appear to clean up some of the generator denials in the journal, but the serial getty is still not started automatically unless I boot with enforcing=0.

With this version I see some similarity to
https://github.com/coreos/fedora-coreos-tracker/issues/1735
https://bugzilla.redhat.com/show_bug.cgi?id=2290482

The linked issue points to this as a fix, which from inspection appears to be included in selinux-policy-41.7-1.fc41, but as noted on the coreos issue and BZ it does not appear to have resolved the problem.
https://github.com/fedora-selinux/selinux-policy/pull/1979 

I am having a difficult time seeing the denial(s) causing the issue.

I have to stop for now, but I'll continue to dig when time permits.

Comment 36 Jason Montleon 2024-07-07 01:13:08 UTC
This is sufficient to get a working console. It looks like systemd_getty_generator_t is missing access to the character device file.

```
module custom-agetty 1.0;

require {
	type tty_device_t;
	type systemd_getty_generator_t;
	class chr_file { ioctl read write };
}

#============= systemd_getty_generator_t ==============
allow systemd_getty_generator_t tty_device_t:chr_file { ioctl read write };
```

If someone else wants to confirm:
- Confirm workarounds are removed, selinux is enforcing, serial-getty service disabled, booting to no console login. 
- Place the contents above in a file `custom-agetty.te`
- Ensure you have selinux-policy-devel installed
- make -f /usr/share/selinux/devel/Makefile custom-agetty.pp
- semodule -i custom-agetty.pp
- reboot

To remove the custom module:
- semodule -r custom-agetty

I tested with selinux-policy-targeted-40.23-1.fc40.noarch and selinux-policy-targeted-41.7-1.fc41.noarch (https://koji.fedoraproject.org/koji/buildinfo?buildID=2480699) and had success with both.

Comment 37 Jason Montleon 2024-07-07 01:18:54 UTC
> With this version I see some similarity to
> https://github.com/coreos/fedora-coreos-tracker/issues/1735
> https://bugzilla.redhat.com/show_bug.cgi?id=2290482
> 
I inadvertently linked back to this bug. That should have been
https://bugzilla.redhat.com/show_bug.cgi?id=2292472

Comment 38 Steve 2024-07-07 02:28:46 UTC
(In reply to Jason Montleon from comment #36)
...
> - Confirm workarounds are removed, selinux is enforcing, serial-getty service disabled, booting to no console login. 
...

Thanks for your detailed instructions. Could you clarify this: "serial-getty service disabled"?

In systemd terminology, I believe we want the serial-getty service *enabled*, but for the failure-reproducer, we want to verify that the serial-getty service is not "active" after booting. This systemctl command will show the state of all the systemd units matching the pattern:

$ systemctl list-units -a serial-getty\*

"The ACTIVE column [in the output] shows the general unit state, one of active, reloading, inactive, failed, activating, deactivating." (systemctl (1))

BTW, you can use "autolinkification" to link to other Bugzilla bugs by typing the literal string "Bug xxxxxxx".
Comments can also linked: "Bug xxxxxxx, Comment yy".
https://bugzilla.redhat.com/docs/en/html/using/tips.html

Comment 39 Jason Montleon 2024-07-07 03:19:30 UTC
It is trivial to work around this issue, even if the generator is not working properly. 

You can just:
```
$ sudo systemctl enable --now serial-getty@ttyS0
Created symlink /etc/systemd/system/getty.target.wants/serial-getty → /usr/lib/systemd/system/serial-getty@.service.
```

But with the generator you're not supposed to require the link; this really should not have to exist.
/etc/systemd/system/getty.target.wants/serial-getty

Disabling the service just removes the link and the state we want to function.
$ sudo systemctl disable --now serial-getty@ttyS0
Removed "/etc/systemd/system/getty.target.wants/serial-getty".


When the generator works properly notice it states `enabled-runtime` instead of `enabled`:
```
# systemctl status serial-getty 
● serial-getty - Serial Getty on ttyS0
     Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; enabled-runtime; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Wed 2024-03-20 20:00:28 EDT; 3 months 16 days ago
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html
   Main PID: 745 (agetty)
      Tasks: 1 (limit: 9461)
     Memory: 472.0K (peak: 6.1M)
        CPU: 102ms
     CGroup: /system.slice/system-serial\x2dgetty.slice/serial-getty
             └─745 /sbin/agetty -o "-p -- \\u" --keep-baud 115200,57600,38400,9600 - vt220
```

vs. `enabled` when manually enabling the service and relying on the link.

```
# systemctl status serial-getty 
● serial-getty - Serial Getty on ttyS0
     Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Wed 2024-03-20 20:00:27 EDT; 3 months 16 days ago
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html
   Main PID: 740 (agetty)
      Tasks: 1 (limit: 9461)
     Memory: 472.0K (peak: 6.3M)
        CPU: 105ms
     CGroup: /system.slice/system-serial\x2dgetty.slice/serial-getty
             └─740 /sbin/agetty -o "-p -- \\u" --keep-baud 115200,57600,38400,9600 - vt220
```

The problem is not very difficult to work around if you are aware of the issue. However, when unsuspecting users flash an sd card for a raspberry pi, visionfive 2, or some other arm or riscv SBC and are relying on serial to configuring it then just appears to freeze after booting, before they have a chance to log in. They don't have ssh or whatever to fall back on at this point. This is roughly what happened to David Marceau when trying to boot a VisionFive 2. I was aware of the issue, happened to see the conversation, and helped walk him through getting logged in.

Comment 40 Jason Montleon 2024-07-07 04:10:35 UTC
Reading up at https://www.freedesktop.org/wiki/Software/systemd/Generators/

I can confirm if the generator is working you will see that the unit file is created here instead:
/run/systemd/generator/getty.target.wants/serial-getty

Comment 41 Steve 2024-07-07 04:39:56 UTC
Jason: Thanks for the detailed explanation. That explains why I cannot reproduce the problem in my VMs.

In my VMs I always do this:

$ sudo systemctl enable --now serial-getty

So, for anyone who just wants a workaround before the problem is fixed, run the above command.

Of course, ssh needs to be working, as you suggest. Or connect a monitor and USB keyboard, if the SBC supports them.

As for how the generator "knows" to generate the service, the device must already exist:

$ journalctl --no-hostname -b | fgrep ttyS0
Jul 06 21:09:31 kernel: 00:00: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

Comment 42 Steve 2024-07-07 06:49:06 UTC
(In reply to Steve from comment #41)
> That explains why I cannot reproduce the problem in my VMs.

Maybe not.

After running:

# systemctl disable --now serial-getty

And booting in permissive mode:

$ getenforce
Permissive

And verifying that the ttyS0 device exists:

$ journalctl --no-hostname -b | fgrep ttyS0
Jul 06 23:13:49 kernel: 00:00: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

$ file /dev/ttyS0
/dev/ttyS0: character special (4/64)

The serial-getty unit is not auto-generated:

$ systemctl list-units -a serial-getty\*
  UNIT LOAD ACTIVE SUB DESCRIPTION

0 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

And there or no messages related to agetty:

$ journalctl --no-hostname -b | fgrep agetty

There must be something else different between a VM and an SBC.

Tested with F40 Workstation in a VM, fully updated.

$ rpm -q selinux-policy systemd
selinux-policy-41.7-1.fc41.noarch
systemd-255.8-1.fc40.x86_64

kernel 6.9.7-200.fc40.x86_64

$ ll -Z /usr/lib/systemd/system-generators/systemd-getty-generator
-rwxr-xr-x. 1 root root system_u:object_r:systemd_getty_generator_exec_t:s0 24440 Jun 28 17:00 /usr/lib/systemd/system-generators/systemd-getty-generator

Comment 43 Jason Montleon 2024-07-07 15:43:55 UTC
From https://0pointer.de/blog/projects/serial-console.html

Add console=ttyS0 to the kernel command line.

You can make it permanent by editing GRUB_CMDLINE_LINUX in /etc/default/grub. If you do it before updating the system it will be applied automatically for you when the kernel is updated without the need to run anything manually.

Otherwise you can probably run:
grubby --update-kernel=ALL --args="console=ttyS0"

From then on in an x86_64 VM the behavior matches what I have described including workarounds and fixes.

Comment 44 Jason Montleon 2024-07-07 15:54:13 UTC
I believe you have to do this in an x86_64 virtual machine because:
"By default systemd will instantiate one serial-getty@.service on the main kernel[4] console, if it is not a virtual terminal."

[4] "If multiple kernel consoles are used simultaneously, the main console is the one listed first in /sys/class/tty/console/active, which is the last one listed on the kernel command line."

Without looking, because I deleted the VM already I am guessing on an x86_64 VM the display vt is the main kernel console. Adding console=ttyS0 probably makes it the main console instead.

Comment 45 Steve 2024-07-07 16:58:39 UTC
Jason: Thanks for researching that. I never would have figured that out. :-)

The log actually shows the difference: tty0 vs ttyS0:

Without console=ttyS0 on the kernel command-line:

$ journalctl --no-hostname -b -1 | fgrep 'legacy console'
Jul 07 07:05:57 kernel: printk: legacy console [tty0] enabled

With console=ttyS0 on the kernel command-line:

$ journalctl --no-hostname -b | fgrep 'legacy console'
Jul 07 09:06:15 kernel: printk: legacy console [ttyS0] enabled

In the latter case, I can now almost reproduce what you reported in Comment 39:

$ sudo setenforce 0

$ getenforce
Permissive

$ sudo systemctl daemon-reload # "This will rerun all generators ..." (systemctl(1))

$ systemctl list-units -a serial-getty\*
  UNIT                       LOAD   ACTIVE   SUB  DESCRIPTION          
  serial-getty loaded inactive dead Serial Getty on ttyS0
...

This shows "enabled-runtime":

$ systemctl status serial-getty
○ serial-getty - Serial Getty on ttyS0
     Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; enabled-runtime; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html

Tested with an F40 VM (x86_64) and no custom selinux policies:

$ rpm -q selinux-policy systemd
selinux-policy-40.23-1.fc40.noarch
systemd-255.8-1.fc40.x86_64

$ uname -r
6.9.7-200.fc40.x86_64

Comment 46 Steve 2024-07-07 17:10:56 UTC
With enforcing=0 and console=ttyS0 on the kernel command-line, I can reproduce in a VM what you reported in Comment 39:

$ cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.9.7-200.fc40.x86_64 root=UUID=3d655a0e-4b35-4a73-bf51-da06a6de53ab ro enforcing=0 console=ttyS0

$ getenforce
Permissive

$ systemctl list-units -a serial-getty\*
  UNIT                       LOAD   ACTIVE SUB     DESCRIPTION          
  serial-getty loaded active running Serial Getty on ttyS0
...

This shows "enabled-runtime":

$ systemctl status serial-getty
● serial-getty - Serial Getty on ttyS0
     Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; enabled-runtime; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Sun 2024-07-07 10:02:06 PDT; 36s ago
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             https://0pointer.de/blog/projects/serial-console.html
   Main PID: 863 (agetty)
      Tasks: 1 (limit: 9462)
     Memory: 448.0K (peak: 6.2M)
        CPU: 13ms
     CGroup: /system.slice/system-serial\x2dgetty.slice/serial-getty
             └─863 /sbin/agetty -o "-p -- \\u" --keep-baud 115200,57600,38400,9600 - vt220

Jul 07 10:02:06 fedora-xfce-1 systemd[1]: Started serial-getty - Serial Getty on ttyS0.
Jul 07 10:02:06 fedora-xfce-1 agetty[863]: failed to open credentials directory

Comment 47 Jason Montleon 2024-07-07 18:58:12 UTC
> In the latter case, I can now almost reproduce what you reported in Comment
> 39:
> 
> $ sudo setenforce 0
> 
> $ getenforce
> Permissive
> 
> $ sudo systemctl daemon-reload # "This will rerun all generators ..."
> (systemctl(1))
> 
> $ systemctl list-units -a serial-getty\*
>   UNIT                       LOAD   ACTIVE   SUB  DESCRIPTION          
>   serial-getty loaded inactive dead Serial Getty on ttyS0
> ...
> 
> This shows "enabled-runtime":
> 
> $ systemctl status serial-getty
> ○ serial-getty - Serial Getty on ttyS0

I don't follow. Doesn't this show exactly what we have reported? You put the system in permissive mode and reloaded the daemon. This is supposed to work on boot in enforcing mode. You're not supposed to have to put the system in permissive mode.

Comment 48 Jason Montleon 2024-07-07 20:21:31 UTC
Full video reproducer from install to fix. You can watch the entire thing, or jump; times for important events are in the description.

https://www.youtube.com/watch?v=XWfZY-l-D7k

Comment 49 Steve 2024-07-07 22:31:46 UTC
(In reply to Jason Montleon from comment #47)
...
> > $ systemctl list-units -a serial-getty\*
> >   UNIT                       LOAD   ACTIVE   SUB  DESCRIPTION          
> >   serial-getty loaded inactive dead Serial Getty on ttyS0
...

> I don't follow. Doesn't this show exactly what we have reported? You put the system in permissive mode and reloaded the daemon.

In Comment 45, I said "almost reproduce" only because the service was "inactive" and "dead".

The essential point is that the service was "enabled-runtime", which means that the generator ran.

I didn't think to try actually starting the service.

> This is supposed to work on boot in enforcing mode.

With your fix, which I was not testing.

> You're not supposed to have to put the system in permissive mode.

I was not verifying a fix but confirming a failure-reproducer, which entails two steps:

1. Boot with enforcing enabled and note that the serial-getty unit is not loaded. This is documented in previous comments.

2. Boot with enforcing disabled (permissive mode) and verify that the unit is loaded and running. This is documented in Comment 46.

From that, we can only deduce that an selinux fix is needed.

The next step would be to test your fix.

Testing with VMs is extremely useful, so when there is a difference in the behavior between a VM and a bare metal install, it is essential to understand why.

Thanks for all your help with this.

Comment 50 Steve 2024-07-08 00:49:41 UTC
(In reply to Jason Montleon from comment #48)
> Full video reproducer from install to fix. You can watch the entire thing, or jump; times for important events are in the description.
> 
> https://www.youtube.com/watch?v=XWfZY-l-D7k

I watched the whole thing, except that I skipped over the familiar parts. :-)

Comment 51 Jonathan Lebon 2024-07-09 16:12:18 UTC
This clearly affects Fedora 40 too, so retargeting. (Initially filed a separate bug in https://bugzilla.redhat.com/show_bug.cgi?id=2296652 before finding this one.)

Comment 52 Jonathan Lebon 2024-07-09 16:12:36 UTC
*** Bug 2296652 has been marked as a duplicate of this bug. ***

Comment 53 Zdenek Pytela 2024-07-09 17:07:31 UTC
Is this issue still in place with selinux-policy-40.23-1.fc40.noarch or selinux-policy-41.7-1.fc41.noarch?
Note policy in F40 and F41 is now quite different regarding systemd.
This bz was reported for F41, we'd rather continue with yours for F40 if still needed.

Comment 54 Jonathan Lebon 2024-07-09 18:27:27 UTC
(In reply to Zdenek Pytela from comment #53)
> Is this issue still in place with selinux-policy-40.23-1.fc40.noarch

Yes. That version is in the latest testing-devel builds and the bug can still be reproduced there: https://builds.coreos.fedoraproject.org/browser?stream=testing-devel&arch=x86_64

> or selinux-policy-41.7-1.fc41.noarch?

Yes. I see the following denials:

Jul 09 18:20:57 localhost kernel: audit: type=1400 audit(1720549256.729:3): avc:  denied  { map_read map_write } for  pid=751 comm="bootc-systemd-g" scontext=system_u:system_r:systemd_generic_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=bpf permissive=1
Jul 09 18:20:57 localhost kernel: audit: type=1400 audit(1720549256.733:4): avc:  denied  { map_read map_write } for  pid=756 comm="kdump-dep-gener" scontext=system_u:system_r:kdump_dep_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=bpf permissive=1
Jul 09 18:20:57 localhost kernel: audit: type=1400 audit(1720549256.734:5): avc:  denied  { map } for  pid=754 comm="coreos-liveiso-" path="/usr/bin/bash" dev="vda4" ino=3032099 scontext=system_u:system_r:systemd_generic_generator_t:s0 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file permissive=1
Jul 09 18:20:57 localhost kernel: audit: type=1400 audit(1720549256.734:6): avc:  denied  { execute } for  pid=754 comm="coreos-liveiso-" path="/usr/bin/bash" dev="vda4" ino=3032099 scontext=system_u:system_r:systemd_generic_generator_t:s0 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file permissive=1
Jul 09 18:20:57 localhost kernel: audit: type=1400 audit(1720549256.734:7): avc:  denied  { map_read map_write } for  pid=753 comm="coreos-installe" scontext=system_u:system_r:coreos_installer_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=bpf permissive=1
Jul 09 18:20:57 localhost kernel: audit: type=1400 audit(1720549256.738:8): avc:  denied  { map_read map_write } for  pid=760 comm="selinux-autorel" scontext=system_u:system_r:selinux_autorelabel_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=bpf permissive=1
Jul 09 18:20:57 localhost kernel: audit: type=1400 audit(1720549256.739:9): avc:  denied  { map_read map_write } for  pid=761 comm="systemd-bless-b" scontext=system_u:system_r:systemd_bless_boot_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=bpf permissive=1
Jul 09 18:20:57 localhost kernel: audit: type=1400 audit(1720549256.740:10): avc:  denied  { map_read map_write } for  pid=762 comm="systemd-cryptse" scontext=system_u:system_r:systemd_cryptsetup_generator_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=bpf permissive=1

but oddly, none of them seem like it's from systemd-getty-generator.

That version is not in the latest FCOS rawhide builds (https://builds.coreos.fedoraproject.org/browser?stream=rawhide&arch=x86_64), but you can download the latest there, boot it with `coreos-assembler run -c` but add `--kargs enforcing=0` to work around the bug, then `rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2024-64134f8805` to test it.

> Note policy in F40 and F41 is now quite different regarding systemd.
> This bz was reported for F41, we'd rather continue with yours for F40 if
> still needed.

Sure, WFM.

Comment 55 Zdenek Pytela 2024-07-09 18:38:28 UTC
All of these are either fixed somewhere (selinux-policy, systemd) or will be with
https://bugzilla.redhat.com/show_bug.cgi?id=2292472

Any other problem like no getty on a serial console?

Comment 56 Jonathan Lebon 2024-07-09 18:45:27 UTC
Right, to be clear, that's still the main problem even though there's no denial entry for it. I was merely showing the denials that *do* show up.

Comment 57 Zdenek Pytela 2024-07-09 19:01:12 UTC
So I suppose

setenforce 0

makes the service working. What will be audited when dontaudit rules are disabled?

semodule -DB

Any entry in journal? What if you triggered generators?

systemctl daemon-reload

Comment 58 Jason Montleon 2024-07-09 19:59:30 UTC
With 40.23 and 41.7 still have to add this.

Without access to the character device file the unit file is not created/started by the generator and there is no login prompt on serial without manual workarounds.

module custom-agetty 1.0;

require {
	type tty_device_t;
	type systemd_getty_generator_t;
	class chr_file { ioctl read write };
}

#============= systemd_getty_generator_t ==============
allow systemd_getty_generator_t tty_device_t:chr_file { ioctl read write };

Comment 59 Jonathan Lebon 2024-07-09 20:06:41 UTC
Created attachment 2039351 [details]
Output of `journalctl -b 0 --grep avc --no-pager` on selinux-policy-41.7-1.fc41

For completeness, I've attached the full list of the denials. The ones mentioning getty are:

```
$ grep getty selinux-policy-41.7-1.fc41-denials.log
Jul 09 19:59:11 localhost.localdomain audit[1108]: AVC avc:  denied  { noatsecure } for  pid=1108 comm="gensnippet_if" scontext=system_u:system_r:NetworkManager_dispatcher_console_t:s0 tcontext=system_u:system_r:getty_t:s0 tclass=process permissive=1
Jul 09 19:59:11 localhost.localdomain audit[1108]: AVC avc:  denied  { rlimitinh } for  pid=1108 comm="agetty" scontext=system_u:system_r:NetworkManager_dispatcher_console_t:s0 tcontext=system_u:system_r:getty_t:s0 tclass=process permissive=1
Jul 09 19:59:11 localhost.localdomain audit[1108]: AVC avc:  denied  { siginh } for  pid=1108 comm="agetty" scontext=system_u:system_r:NetworkManager_dispatcher_console_t:s0 tcontext=system_u:system_r:getty_t:s0 tclass=process permissive=1
Jul 09 19:59:11 localhost.localdomain audit[1070]: AVC avc:  denied  { checkpoint_restore } for  pid=1070 comm="agetty" capability=40  scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tclass=capability2 permissive=1
Jul 09 19:59:21 localhost.localdomain audit[1070]: AVC avc:  denied  { noatsecure } for  pid=1070 comm="agetty" scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tclass=process permissive=1
Jul 09 19:59:21 localhost.localdomain audit[1070]: AVC avc:  denied  { read write } for  pid=1070 comm="login" path="socket:[10160]" dev="sockfs" ino=10160 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tclass=netlink_route_socket permissive=1
Jul 09 19:59:21 localhost.localdomain audit[1070]: AVC avc:  denied  { rlimitinh } for  pid=1070 comm="login" scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tclass=process permissive=1
Jul 09 19:59:21 localhost.localdomain audit[1070]: AVC avc:  denied  { siginh } for  pid=1070 comm="login" scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tclass=process permissive=1
```

Comment 60 Rob Foehl 2024-07-09 20:10:12 UTC
(In reply to Zdenek Pytela from comment #57)
> So I suppose
> 
> setenforce 0
> 
> makes the service working. What will be audited when dontaudit rules are
> disabled?
> 
> semodule -DB
> 
> Any entry in journal? What if you triggered generators?
> 
> systemctl daemon-reload

Yes, disabling dontaudit rules is a prerequisite.  There's plenty of detail in comment 36.

Why is this so difficult?  Same pattern of behavior, bug after bug.

Comment 61 Adam Williamson 2024-07-09 20:32:28 UTC
Zdenek: additionally, I'm not sure you realize this: selinux-policy-41.7-1.fc41 is not in Rawhide. It failed gating because it (still) breaks FreeIPA. I reported this at https://bodhi.fedoraproject.org/updates/FEDORA-2024-64134f8805#comment-3600824 . The current version in Rawhide is selinux-policy-41.3-1.fc41 . You need to fix the FreeIPA issues to get a new build into Rawhide.

Comment 62 Steve 2024-07-10 15:08:22 UTC
I'm not sure if selinux-policy-41.8-1.fc41.noarch is supposed to have fixed this bug or not, but it doesn't:

https://bodhi.fedoraproject.org/updates/FEDORA-2024-2711625691

In a clean install of F41 in a VM with:

$ cat /proc/cmdline 
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.10.0-0.rc7.58.fc41.x86_64 root=UUID=975cca99-7a74-4bf7-a8ad-5e5050cc6a55 ro rootflags=subvol=root console=ttyS0

$ getenforce
Enforcing

There are no AVCs:

$ journalctl --no-hostname -b | egrep -i 'legacy console|avc'
Jul 10 07:39:48 kernel: printk: legacy console [ttyS0] enabled

Yet serial-getty had to be started manually:

$ sudo systemctl start serial-getty

Comment 63 Steve 2024-07-10 16:09:28 UTC
(In reply to Steve from comment #62)
> I'm not sure if selinux-policy-41.8-1.fc41.noarch is supposed to have fixed this bug or not, but it doesn't:
> 
> https://bodhi.fedoraproject.org/updates/FEDORA-2024-2711625691
...

I just realized that "this bug" concerns openQA tests of FreeIPA and that those tests with selinux-policy-41.8-1.fc41.noarch appear to have passed.

So, ISTM, we need:

1. A new bug report concerning auto-generation of serial-getty.

2. An openQA test for auto-generation of serial-getty.

Comment 64 Steve 2024-07-10 17:09:27 UTC
(In reply to Adam Williamson from comment #0)
> The openQA serial console install test started failing in Fedora-Rawhide-20240601.n.0. This turns out to be an SELinux policy issue.
...

Adam: Could you please include a link to the actual openQA test suite in which there was a failure?

The whiteboard says "openqa", so there should really be a link to tests relevant to this bug report.

Comment 65 Adam Williamson 2024-07-10 17:50:01 UTC
https://openqa.fedoraproject.org/tests/2720061

Comment 66 Steve 2024-07-10 19:46:59 UTC
(In reply to Adam Williamson from comment #65)
> https://openqa.fedoraproject.org/tests/2720061

Thanks, Adam. Very interesting.

So the "_console_wait_login" test failed with Fedora-Rawhide-20240709.n.0.

I looked at every log and couldn't find the version of selinux-policy that was tested. This is the best that I could find:

"Installing selinux-policy.noarch (467/617)"
https://openqa.fedoraproject.org/tests/2720061/logfile?filename=serial_terminal_user.txt

The version is, however, in the logs under ./var/log/anaconda/ in the tarball:
https://openqa.fedoraproject.org/tests/2720061/file/_console_wait_login-var_log.tar.gz

$ fgrep selinux-policy ./var/log/anaconda/lorax-packages.log
selinux-policy-41.3-1.fc41.noarch
selinux-policy-targeted-41.3-1.fc41.noarch

For anyone who wants to follow along:

selinux-policy updates:
https://bodhi.fedoraproject.org/updates/?packages=selinux-policy

Fedora nightly compose finder (These appear to be the same as the images that are tested with openQA.):
https://openqa.fedoraproject.org/nightlies.html

Summary log of openQA test for "install_serial_console":
https://openqa.fedoraproject.org/tests/2720061#next_previous

Comment 67 Steve 2024-07-10 22:38:32 UTC
(In reply to Steve from comment #66)
...
> Fedora nightly compose finder (These appear to be the same as the images that are tested with openQA.):
> https://openqa.fedoraproject.org/nightlies.html
...

They are indeed the same. Even better, if you put your pointer over a red link (meaning a test for that image failed), you get a list of links to the actual tests that failed. Very nice!

Comment 68 Steve 2024-07-16 21:18:07 UTC
selinux-policy-41.9-1.fc41 restores auto-generation of serial-getty:
https://bodhi.fedoraproject.org/updates/FEDORA-2024-3510bbb1bb

$ systemctl show --property=UnitFileState serial-getty
UnitFileState=enabled-runtime

Tested in an F41 Server VM with:

$ cat /proc/cmdline 
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-6.10.0-64.fc41.x86_64 root=UUID=e94b97ba-d791-45cf-85cf-925c1de42ce8 ro console=ttyS0

I don't know what the plan is for an F40 update, but progress can be tracked at these links:

Builds:
https://koji.fedoraproject.org/koji/packageinfo?packageID=32

Updates:
https://bodhi.fedoraproject.org/updates/?packages=selinux-policy

Comment 69 Steve 2024-07-24 02:25:51 UTC
Reposting from Bug 2298080, which is explicitly listed under the "Bugs" tab:

FEDORA-2024-391cfa58c2 (selinux-policy-40.25-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-391cfa58c2

Comment 70 Steve 2024-07-26 02:14:52 UTC
selinux-policy-40.26-1.fc40 fixes Bug 2298080:
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f6d12d5c36

Auto-generation of serial-getty works as expected.

Procedure:

Boot F40 VM with "console=ttyS0" on the kernel command-line.

In virt-manager VM window, select "View:Consoles:Serial 1" and login.

$ tty
/dev/ttyS0

$ systemctl show --property UnitFileState serial-getty
UnitFileState=enabled-runtime

Tested with:

systemd-255.8-1.fc40.x86_64
kernel 6.9.10-200.fc40.x86_64

Comment 71 Adam Williamson 2024-07-27 00:50:04 UTC
This is fixed for Rawhide since Fedora-Rawhide-20240719.n.1 . Dropping it as an F41 blocker.

Comment 72 Fedora Update System 2024-08-07 10:34:22 UTC
FEDORA-2024-995d585c91 (selinux-policy-40.27-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-995d585c91

Comment 73 Fedora Update System 2024-08-08 04:46:50 UTC
FEDORA-2024-995d585c91 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-995d585c91`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-995d585c91

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

Comment 74 Fedora Update System 2024-08-11 04:49:19 UTC
FEDORA-2024-995d585c91 (selinux-policy-40.27-1.fc40) has been pushed to the Fedora 40 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.