kmod_selinux(8)
πΈ kmod_selinux(8) β the SELinux tea for kmod, bestie π
Okay so this is the manual page for kmod_selinux, and it's literally the Security Enhanced Linux policy for all the kmod processes. We're talking SELinux Policy kmod energy, and I'm gonna walk you through every single detail so you can flex on your sysadmin friends. No cap, this is important stuff. π«Ά
β¨ NAME β¨
kmod_selinux β Security Enhanced Linux Policy for the kmod processes. Periodt. That's the whole vibe. π
π¦ DESCRIPTION π¦
Security-Enhanced Linux secures the kmod processes via flexible mandatory access control. It's giving "I'm the main character of kernel module management" energy, honestly.
The kmod processes execute with the kmod_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier.
For example:
ps -eZ | grep kmod_t
That's it. That's the vibe check. If you see kmod_t in the output, slay, you've got kmod processes running under this domain. π₯
πͺ ENTRYPOINTS πͺ
The kmod_t SELinux type can be entered via the kmod_exec_t file type. Think of it like the VIP entrance to the club, bestie. β¨
The default entrypoint paths for the kmod_t domain are the following:
/usr/bin/rmmod.*, /usr/bin/depmod.*, /usr/bin/insmod.*,
/usr/bin/modprobe.*, /usr/bin/kmod, /usr/bin/modules-update,
/usr/bin/update-modules, /usr/bin/generate-modprobe.conf
Literally all the module-loading icons. Obsessed. π
π PROCESS TYPES π
SELinux defines process types (domains) for each process running on the system. It's giving organization and structure, and honestly? We love to see it.
You can see the context of a process using the -Z option to ps.
Policy governs the access confined processes have to files. SELinux kmod policy is very flexible allowing users to setup their kmod processes in as secure a method as possible. It's the bestie that lets you set boundaries but still have fun. π
The following process types are defined for kmod:
kmod_t
Note:semanage permissive -a kmod_tcan be used to make the process typekmod_tpermissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. So like, it's chill but it's still watching you. π
β BOOLEANS β
SELinux policy is customizable based on least access required. kmod policy is extremely flexible and has several booleans that allow you to manipulate the policy and run kmod with the tightest access possible. We're talking fine-tuning your aesthetic, but for security. π
mmap_low_allowedβ If you want to control the ability to mmap a low area of the address space, as configured by/proc/sys/vm/mmap_min_addr, you must turn on themmap_low_allowedboolean. Disabled by default. Turn it on with:
setsebool -P mmap_low_allowed 1
nis_enabledβ If you want to allow system to run with NIS, you must turn on thenis_enabledboolean. Disabled by default. Turn it on with:
setsebool -P nis_enabled 1
secure_mode_insmodβ If you want to disable kernel module loading, you must turn on thesecure_mode_insmodboolean. Disabled by default. Turn it on with:
setsebool -P secure_mode_insmod 1
selinuxuser_execheapβ If you want to allow unconfined executables to make their heap memory executable, you must turn on theselinuxuser_execheapboolean. Doing this is a really bad idea. Probably indicates a badly coded executable, but could indicate an attack. This executable should be reported in bugzilla. Disabled by default. Turn it on with:
setsebool -P selinuxuser_execheap 1
π«’ Warning: Executable heap memory is like wearing socks with sandals. Technically possible, but why would you? And also, it might mean someone's trying to hack you, so like, report that executable in bugzilla fr fr.
selinuxuser_execstackβ If you want to allow unconfined executables to make their stack executable, you must turn on theselinuxuser_execstackboolean. This should never, ever be necessary. Probably indicates a badly coded executable, but could indicate an attack. This executable should be reported in bugzilla. Disabled by default. Turn it on with:
setsebool -P selinuxuser_execstack 1
π Warning: Executable stack memory is giving "I forgot how computers work." It should never, ever be necessary. If you turn this on, something is deeply wrong and you should probably be reporting a bug. Not the vibe.
π MANAGED FILES π
The SELinux process type kmod_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the process's UID still needs to have DAC permissions. So like, SELinux can approve it but the regular file permissions still have to check out too. π
file_type- all files on the system
π·οΈ FILE CONTEXTS π·οΈ
SELinux requires files to have an extended attribute to define the file type. It's like every file has a little name tag at the party. π
You can see the context of a file using the -Z option to ls.
Policy governs the access confined processes have to these files. SELinux kmod policy is very flexible allowing users to setup their kmod processes in as secure a method as possible. Iconic flexibility, honestly. β¨
STANDARD FILE CONTEXT
SELinux defines the file context types for the kmod. If you wanted to store files with these types in different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk.
semanage fcontext -a -t kmod_exec_t '/srv/kmod/content(/.*)?'
restorecon -R -v /srv/mykmod_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. It's regex bestie hours up in here. π§
The following file types are defined for kmod:
kmod_exec_tβ Set files with thekmod_exec_ttype, if you want to transition an executable to thekmod_tdomain.
Paths:
/usr/bin/rmmod.*, /usr/bin/depmod.*, /usr/bin/insmod.*,
/usr/bin/modprobe.*, /usr/bin/kmod, /usr/bin/modules-update,
/usr/bin/update-modules, /usr/bin/generate-modprobe.conf
kmod_tmp_tβ Set files with thekmod_tmp_ttype, if you want to storekmodtemporary files in the/tmpdirectories. Temporary file realness. πkmod_tmpfs_tβ Set files with thekmod_tmpfs_ttype, if you want to storekmodfiles on a tmpfs file system.kmod_var_run_tβ Set files with thekmod_var_run_ttype, if you want to store thekmodfiles under the/runor/var/rundirectory.
Paths:
/run/tmpfiles.d/kmod.conf, /run/tmpfiles.d/static-nodes.conf
Note: File context can be temporarily modified with thechconcommand. If you want to permanently change the file context you need to use thesemanage fcontextcommand. This will modify the SELinux labeling database. You will need to userestoreconto apply the labels. That's the whole glow-up process:semanagefor the permanent label,restoreconto actually put it on the file. π
π» COMMANDS π»
Here's the part where we list all the tools you can use to manipulate the policy. Slay. π₯
semanage fcontextcan also be used to manipulate default file context mappings.semanage permissivecan also be used to manipulate whether or not a process type is permissive.semanage modulecan also be used to enable/disable/install/remove policy modules.semanage booleancan also be used to manipulate the booleans.system-config-selinuxis a GUI tool available to customize SELinux policy settings. For when you want to click buttons instead of typing. No judgment. π±οΈβ¨
βοΈ AUTHOR βοΈ
This manual page was auto-generated using sepolicy manpage. It's giving "the robots wrote this but the vibes are immaculate." π«Ά
π SEE ALSO π
selinux(8), kmod(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8)
π Okay bestie, that's the whole page! π Every flag, every path, every boolean, every warning, every reference β all present and accounted for. You're now officially caught up on the kmod SELinux policy tea. Go forth and slay your security config. π¦β¨
This page is from kmod, dated 26-10-06 β stay safe and stay secure, babe! π
π
π¦ where this page comes from
- opensuse-leap 16.0: selinux-policy-doc 20250627+git412.dbf877ab7-160000.1.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms