Bug 2308177 - read denial for /proc/sysinfo cause systemd-ssh-generator to fail
Summary: read denial for /proc/sysinfo cause systemd-ssh-generator to fail
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 41
Hardware: s390x
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/coreos/fedora-core...
Whiteboard: AcceptedFreezeException
Depends On:
Blocks: F41BetaFreezeException
TreeView+ depends on / blocked
 
Reported: 2024-08-27 14:58 UTC by JB Trystram
Modified: 2024-09-09 21:12 UTC (History)
9 users (show)

Fixed In Version: selinux-policy-41.15-1.fc41
Clone Of:
Environment:
Last Closed: 2024-09-09 21:12:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 2326 0 None Merged Allow systemd-ssh-generator read sysctl files 2024-09-03 20:54:40 UTC

Description JB Trystram 2024-08-27 14:58:33 UTC
systemd 256 ssh-generator looks vor virtualisation info in /proc/sysinfo on s390x hosts. 
The read operation is rejected and causes the service to fail. 

Here is the audit entry : 
```
[    8.111974] audit: type=1400 audit(1724677759.011:4): avc:  denied  { read } for  pid=1358 comm="systemd-ssh-gen" name="sysinfo" dev="proc" ino=4026531945 scontext=system_u:system_r:systemd_ssh_generator_t:s0 tcontext=system_u:object_r:sysctl_t:s0 tclass=file permissive=0
```



Reproducible: Always

Steps to Reproduce:
try to boot a s390x coreOS VM with systemd256
Actual Results:  
/usr/lib/systemd/system-generators/systemd-ssh-generator failed with exit status 1.


Expected Results:  
everything start properly

/proc/sysinfo seem to only exist on s390x architecture : https://github.com/coreos/fedora-coreos-tracker/issues/1786#issuecomment-2312756441 

Relevant code in systemd : 

https://github.com/systemd/systemd/blob/9c0aee7cbbc82aa030ba9c78af1e7fd0ff520d27/src/ssh-generator/ssh-generator.c#L197 --> ... --> https://github.com/systemd/systemd/blob/9c0aee7cbbc82aa030ba9c78af1e7fd0ff520d27/src/basic/virt.c#L424-L445 where we clearly see the s390x-specific bits.

Comment 1 packager-dashboard-bot 2024-09-03 20:51:43 UTC
Proposed as a Freeze Exception for 41-beta by Fedora user jbtrystram using the blocker tracking app because:

 This cause systemd-ssh-generator to fail on s390x hosts.

It's already fixed in https://bodhi.fedoraproject.org/updates/FEDORA-2024-1597066f01 
I tested the fixed selinux-rpm and can confirm it solves the issue

Comment 2 Fedora Update System 2024-09-05 11:59:25 UTC
FEDORA-2024-1597066f01 (selinux-policy-41.15-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-1597066f01

Comment 3 Adam Williamson 2024-09-09 15:19:54 UTC
+4 in https://pagure.io/fedora-qa/blocker-review/issue/1639 , marking accepted.

Comment 4 Fedora Update System 2024-09-09 21:12:12 UTC
FEDORA-2024-1597066f01 (selinux-policy-41.15-1.fc41) has been pushed to the Fedora 41 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.