Skip to contentSkip to conversation

Backwards compatibility (proposal for a new compat_net like flag)

DISCUSSION Paul Moore 2 participants 3 messages Aug 30, 2007 SELinux security module

lore
Share & tools
lore

Paul Moore

author
#0 lore raw

As you may have noticed there has been a _lot_ of discussion lately about the labeled networking functionality in SELinux and how to both improve the existing functionality as well as introduce new functionality to enable SELinux to be used in more and more places. Several different things were debated including fallback peer labels, packet flow control, loopback labeling, and the use of unified access checks for the different peer labeling mechanisms (NetLabel, labeled IPsec).

While it should be possible to implement some of the new ideas while retaining backwards compatibility (fallback labels, loopback labeling) some other ideas would most likely introduce problems when used with older policy (packet flow control, unified access checks). Unfortunately, as discussed numerous times before, we don't presently have a good way to select kernel behavior at runtime and if we want to move forward with some of the new labeled networking ideas we need a way to preserve the existing behavior.

To help solve this problem I'd like to propose we introduce a new tunable, similar to the existing compat_net flag, but instead of it being a simple boolean value I would like to implement it as an integer value. This new tunable, let's call it "select_net", would act as a versioning value for the network access controls. The existing behavior would be used when select_net==0 and the new behavior would be used when select_net==1; if we needed to introduce new checks in the future which could break compatibility we only enable them when select_net==2.

Thoughts? It's not perfect, I know, but I'd like to be able to start moving forward with some of these labeled networking changes but the compatibility concerns are crippling us ...

Signature · 7 lines
paul moore
linux security @ hp

--
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.
#1 lore raw
Quoted 25 lines · Paul Moore

As you may have noticed there has been a _lot_ of discussion lately about the labeled networking functionality in SELinux and how to both improve the existing functionality as well as introduce new functionality to enable SELinux to be used in more and more places. Several different things were debated including fallback peer labels, packet flow control, loopback labeling, and the use of unified access checks for the different peer labeling mechanisms (NetLabel, labeled IPsec).

While it should be possible to implement some of the new ideas while retaining backwards compatibility (fallback labels, loopback labeling) some other ideas would most likely introduce problems when used with older policy (packet flow control, unified access checks). Unfortunately, as discussed numerous times before, we don't presently have a good way to select kernel behavior at runtime and if we want to move forward with some of the new labeled networking ideas we need a way to preserve the existing behavior.

To help solve this problem I'd like to propose we introduce a new tunable, similar to the existing compat_net flag, but instead of it being a simple boolean value I would like to implement it as an integer value. This new tunable, let's call it "select_net", would act as a versioning value for the network access controls. The existing behavior would be used when select_net==0 and the new behavior would be used when select_net==1; if we needed to introduce new checks in the future which could break compatibility we only enable them when select_net==2.

Quoted 3 lines

Thoughts? It's not perfect, I know, but I'd like to be able to start moving forward with some of these labeled networking changes but the compatibility concerns are crippling us ...

Why make it specific to the network access controls, vs. a general versioning scheme for permission checks as discussed in the allow unknown thread? Also, decoupling it from the policy as a separate selinuxfs setting is problematic - what we want is a way for a given policy to select the right mode based on the checks it expects/requires. The separate setting makes it more likely to be out of sync and means we can't atomically change it and load new policy together.

BTW, the allow unknown patches could still be merged if we think they would be useful; they are mostly just pending on some requested cleanups. They would at least avoid causing denials on new permission checks until policy defines them, once policies are deployed with the new flag.

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.
author
#2 lore raw
Quoted 8 lines · Stephen Smalley
Quoted 3 lines · Paul Moore

Thoughts? It's not perfect, I know, but I'd like to be able to start moving forward with some of these labeled networking changes but the compatibility concerns are crippling us ...

Why make it specific to the network access controls, vs. a general versioning scheme for permission checks as discussed in the allow unknown thread?

Just trying to limit the impact. I would much prefer to utilize an existing versioning scheme.

Quoted 11 lines

Also, decoupling it from the policy as a separate
selinuxfs setting is problematic - what we want is a way for a given policy to select the right mode based on the checks it expects/requires. The separate setting makes it more likely to be out of sync and means we can't atomically change it and load new policy together.

BTW, the allow unknown patches could still be merged if we think they would be useful; they are mostly just pending on some requested cleanups. They would at least avoid causing denials on new permission checks until policy defines them, once policies are deployed with the new flag.

I'm open to suggestions.

While the allow unknown class/perm patches would help in the case of new access checks it wouldn't help to "toggle" between different types of access checks in a way that a versioning scheme would (at least it wouldn't in it's current form).

Signature · 7 lines
paul moore
linux security @ hp

--
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.