Skip to contentSkip to conversation

A few questions

DISCUSSION Yao 4 participants 4 messages Mar 7, 2012 SELinux security module

lore
Share & tools
lore

Yao

author
#0 lore raw

Hi,
Lately I'm studying SELinux and got some questions which I want to be clear.

(1)I know SELinux is based on Flask architecture and I know where the SS is, but I'm not sure where the OM locates, I guess the variable "security_ops" which belongs to LSM represents the OM, am I right?

(2)the struct "selinux_ops" in file hooks.c is declared as "static", why not add "const" qualifier so that the it will be put in read-only data section in the kernel?

(3)Is there any way to hack the SELinux, I mean, to disable it on the fly? For example, replace the policy db with a blank file so that any permission is allowed. Is it feasible?

Regards,
Yao

#1 lore raw

2012/3/7 Yao <[email protected]>:

Quoted 3 lines

(2)the struct "selinux_ops" in file hooks.c is declared as "static", why not add "const" qualifier so that
the it will be put in read-only data section in the kernel?

I probably can. Thanks for the suggestion.

Quoted 3 lines

(3)Is there any way to hack the SELinux, I mean, to disable it on the fly? For example, replace the policy db with a
blank file so that any permission is allowed. Is it feasible?

There have been kernel attacks which disable SELinux. If you can write to arbitrary kernel memory you can win. But I'm not going to
help tell you how to write your rootkit :)

--
This message was distributed to subscribers of the selinux mailing 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
In reply to Yao
Quoted 13 lines · Yao

Hi,
Lately I'm studying SELinux and got some questions which I want to be clear.

(1)I know SELinux is based on Flask architecture and I know where the SS is, but I'm not sure
where the OM locates, I guess the variable "security_ops" which belongs to LSM represents the OM, am I right?

(2)the struct "selinux_ops" in file hooks.c is declared as "static", why not add "const" qualifier so that
the it will be put in read-only data section in the kernel?

Quoted 6 lines

(3)Is there any way to hack the SELinux, I mean, to disable it on the fly? For example, replace the policy db with a
blank file so that any permission is allowed. Is it feasible?

Regards,
Yao

So In order.

I asked (1) when I first started as well and the answer I got was the kernel itself is the object manager. You'll notice a bunch of security_ calles through the kernel. These are the enforcement points which query the security server through the selinux specific hooks behind the LSM interface.

(2) I'm not sure if there is a reason not to. I don't know how this would effect runtime disabling since we unhook those functions if we are disabled.

(3) So if you're in the kernel there are techniques to disable SELinux and make it appear like it is still running. Replacing the policy db with an empty one would be the opposite of the effect you want. Since SELinux is deny by default it would give you a system with no access not all access. The MDP program in the kernel tree makes a policy with one type that has access to everything but that would be obvious and not useful. Especially when all of the domains you're programs are currently running in suddenly disappear.

Dave

--
This message was distributed to subscribers of the selinux mailing 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
Quoted 21 lines · David Quigley
Quoted 13 lines · Yao

Hi,
Lately I'm studying SELinux and got some questions which I want to be clear.

(1)I know SELinux is based on Flask architecture and I know where the SS is, but I'm not sure
where the OM locates, I guess the variable "security_ops" which belongs to LSM represents the OM, am I right?

(2)the struct "selinux_ops" in file hooks.c is declared as "static", why not add "const" qualifier so that
the it will be put in read-only data section in the kernel?

Quoted 6 lines

(3)Is there any way to hack the SELinux, I mean, to disable it on the fly? For example, replace the policy db with a
blank file so that any permission is allowed. Is it feasible?

Regards,
Yao

Quoted 7 lines

So In order.

I asked (1) when I first started as well and the answer I got was the kernel itself is the object manager. You'll notice a bunch of security_ calles through the kernel. These are the enforcement points which query the security server through the selinux specific hooks behind the LSM interface.

In general, the "object manager" is the component that implements the object abstraction and operations and is responsible for enforcement of the policy decisions. The kernel can either be viewed as a single object manager or as a collection of object managers (e.g. the process management subsystem, the vfs and filesystem implementations, the networking subsystem, the ipc subsystem, ...). In the case of the Flask microkernel-based OS, the various subsystems were in fact separate tasks running on the microkernel.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.