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

files, init: filetrans /run/machine-id etc_runtime_t #874

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

21sw-clayton
Copy link
Contributor

type=PROCTITLE proctitle=/usr/lib/systemd/systemd-logind

type=SYSCALL arch=armeb syscall=openat per=PER_LINUX success=yes exit=21 a0=AT_FDCWD a1=0xb6eb6c2c a2=O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC a3=0x0 items=0 ppid=1 pid=435 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=systemd-logind exe=/usr/lib/systemd/systemd-logind subj=system_u:system_r:systemd_logind_t:s0 key=(null)

type=AVC avc:  denied  { open } for  pid=435 comm=systemd-logind path=/etc/machine-id dev="tmpfs" ino=13 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:init_runtime_t:s0 tclass=file

type=AVC avc:  denied  { read } for  pid=435 comm=systemd-logind name=machine-id dev="tmpfs" ino=13 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:init_runtime_t:s0 tclass=file

--

systemd-devel
Reproduction and suggestion to use dedicated type (TODO)

--

Fedora:

$ matchpathcon /run/machine-id
/run/machine-id system_u:object_r:machineid_t:s0

init.fc

$ sesearch --type_transition --class file --source init_t --target var_run_t | grep machine
type_transition init_t var_run_t:file machineid_t machine-id;

init.te

type=PROCTITLE proctitle=/usr/lib/systemd/systemd-logind

type=SYSCALL arch=armeb syscall=openat per=PER_LINUX success=yes exit=21
a0=AT_FDCWD a1=0xb6eb6c2c a2=O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC
a3=0x0 items=0 ppid=1 pid=435 auid=unset uid=root gid=root euid=root
suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset
comm=systemd-logind exe=/usr/lib/systemd/systemd-logind
subj=system_u:system_r:systemd_logind_t:s0 key=(null)

type=AVC avc:  denied  { open } for  pid=435 comm=systemd-logind
path=/etc/machine-id dev="tmpfs" ino=13
scontext=system_u:system_r:systemd_logind_t:s0
tcontext=system_u:object_r:init_runtime_t:s0 tclass=file

type=AVC avc:  denied  { read } for  pid=435 comm=systemd-logind
name=machine-id dev="tmpfs" ino=13
scontext=system_u:system_r:systemd_logind_t:s0
tcontext=system_u:object_r:init_runtime_t:s0 tclass=file

--

https://www.spinics.net/lists/systemd-devel/msg09631.html
Reproduction and suggestion to use dedicated type (TODO)

--

Fedora:

$ matchpathcon /run/machine-id
/run/machine-id system_u:object_r:machineid_t:s0

https://github.com/fedora-selinux/selinux-policy/blob/v41.33/policy/modules/system/init.fc#L67

$ sesearch --type_transition --class file --source init_t
--target var_run_t | grep machine
type_transition init_t var_run_t:file machineid_t machine-id;

https://github.com/fedora-selinux/selinux-policy/blob/v41.33/policy/modules/system/init.te#L241

Signed-off-by: Clayton Casciato <ccasciato@21sw.us>
@pebenito pebenito merged commit 442efd2 into SELinuxProject:main Mar 17, 2025
118 checks passed
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy