Skip to contentSkip to conversation

kmod.te

DISCUSSION Russell Coker 2 participants 5 messages May 3, 2002 – May 9, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

In the latest sample policy we have:
can_exec(kmod_t,modprobe_exec_t)
can_exec(kmod_t,insmod_exec_t)

I don't like that idea. I have the following:
domain_auto_trans(kmod_t,insmod_exec_t,insmod_t)

My idea is that it's better to use domain_auto_trans to give access to the insmod_t domain than to give other domains extra privs (although kmod_t should be safe ;).

Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.

--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 3 lines · Russell Coker

In the latest sample policy we have:
can_exec(kmod_t,modprobe_exec_t)
can_exec(kmod_t,insmod_exec_t)

This isn't new to the latest sample policy - in fact, these rules even appear in the original SELinux prototype's policy.

Quoted 6 lines

I don't like that idea. I have the following:
domain_auto_trans(kmod_t,insmod_exec_t,insmod_t)

My idea is that it's better to use domain_auto_trans to give access to the insmod_t domain than to give other domains extra privs (although kmod_t should be safe ;).

If you perform a transition from kmod_t to insmod_t, then you can no longer distinguish between module insertions initiated by the kernel vs. module insertions initiated by some user process that can transition to insmod_t. Consider the scenario where someone wishes to prohibit all insertions by user processes but is willing to allow insertions initiated by the kernel. Hence, it seems preferable to remain in kmod_t so that the policy can distinguish these events if desired.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
Quoted 7 lines · Stephen Smalley

If you perform a transition from kmod_t to insmod_t, then you can no longer distinguish between module insertions initiated by the kernel vs. module insertions initiated by some user process that can transition to insmod_t. Consider the scenario where someone wishes to prohibit all insertions by user processes but is willing to allow insertions initiated by the kernel. Hence, it seems preferable to remain in kmod_t so that the policy can distinguish these events if desired.

By the way, this is mentioned in the old policy technical report, although it is admittedly buried:

When executed by the kernel module loader, the \texttt{modprobe} and \texttt{insmod} programs remain in the \emph{kmod\_t} domain. This allows the security policy to distinguish between permissions granted to the kernel module loader and permissions granted to module utilities executed by user processes. For example, the security policy could be configured to prohibit any transitions to the \emph{modprobe\_t} and \emph{insmod\_t} domains while still allowing the kernel module loader to function.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#3 lore raw
In reply to Stephen Smalley
Quoted 7 lines · Stephen Smalley
Quoted 6 lines

I don't like that idea. I have the following:
domain_auto_trans(kmod_t,insmod_exec_t,insmod_t)

My idea is that it's better to use domain_auto_trans to give access to the insmod_t domain than to give other domains extra privs (although kmod_t should be safe ;).

Quoted 7 lines

If you perform a transition from kmod_t to insmod_t, then you can no longer distinguish between module insertions initiated by the kernel vs. module insertions initiated by some user process that can transition to insmod_t. Consider the scenario where someone wishes to prohibit all insertions by user processes but is willing to allow insertions initiated by the kernel. Hence, it seems preferable to remain in kmod_t so that the policy can distinguish these events if desired.

Fair point.

In that case I think that we should have a macro for the majority of the insmod policy instead of duplicating policy code. I suggest that the macro be in the start of modutil.te and be used twice from there. I think that such policy belongs in modutil.te because the modules utilities are optional (you can compile a kernel without module support), but kmod.te will always be required.

Also is there any system using a version of modutils that has separate programs for insmod, rmmod, and modprobe but which runs the required versions of all other software for running SE Linux? If not then I suggest that we remove all references to having separate programs from the policy.

Signature · 9 lines
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.

--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#4 lore raw
Quoted 6 lines · Russell Coker

In that case I think that we should have a macro for the majority of the insmod policy instead of duplicating policy code. I suggest that the macro be in the start of modutil.te and be used twice from there. I think that such policy belongs in modutil.te because the modules utilities are optional (you can compile a kernel without module support), but kmod.te will always be required.

I'm not sure I follow you. If you want a shared macro between kmod.te and modutils.te, then we should create a new macros file, e.g. macros/program/modutils_macros.te.

Quoted 4 lines

Also is there any system using a version of modutils that has separate programs for insmod, rmmod, and modprobe but which runs the required versions of all other software for running SE Linux? If not then I suggest that we remove all references to having separate programs from the policy.

That's fine with me as long as it doesn't break compatibility for any SELinux users.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.