Force avc_has_perm to return success if enforcing == 0;
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I would like to patch libselinux to always return 0 on avc_has_perm if the machine is in permissive mode.
This will allow Userspace Object Managers to work even if the system is totally mislabeled and processes as running with bad context. Currently if a program like dbus asks with a bad process label it can get denials even in permissive mode.
Does anyone see a problem with this?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk860IQACgkQrlYvE4MpobNPFwCfVbE1QGJ0M8byHYZlf2U3XpdE Ga0An2Z2/wBklr/e6OX+4EYTrFDvL69o
=btOY
-----END PGP SIGNATURE-----
libselinux/src/avc.c +1 -0
@@ -801,6 +801,7 @@ int avc_has_perm_noaudit(security_id_t ssid, out:avc_release_lock (avc_lock); +if (!avc_enforcing)return 0 ;return rc; }
Quoted 6 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1I would like to patch libselinux to always return 0 on
avc_has_permif the machine is in permissive mode.
Quoted 6 lines
This will allow Userspace Object Managers to work even if the system is totally mislabeled and processes as running with bad context. Currently if a program like dbus asks with a bad process label it can get denials even in permissive mode.
Does anyone see a problem with this?
I'm not fond of it. Permissive mode is just supposed to control whether permission is granted, not to hide other kinds of errors. Consider how difficult debugging of an actual failure will be if it only shows up in enforcing mode even though it has nothing to do with policy.
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.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 11 lines · Stephen Smalley
Quoted 10 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I would like to patch libselinux to always return 0 on
avc_has_permif the machine is in permissive mode.This will allow Userspace Object Managers to work even if the system is totally mislabeled and processes as running with bad context. Currently if a program like dbus asks with a bad process label it can get denials even in permissive mode.
Quoted 8 lines
Quoted 1 line
Does anyone see a problem with this?
I'm not fond of it. Permissive mode is just supposed to control whether permission is granted, not to hide other kinds of errors. Consider how difficult debugging of an actual failure will be if it only shows up in enforcing mode even though it has nothing to do with policy.
Well I guess I can only due the return in the audit_has_perm not the audit_has_perm_noaudit, since then the audit message will get generated but dbus,passwd,xserver ... will allow the access.
If an app calls audit_has_perm_noaudit, it will still return failure. -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk89FLMACgkQrlYvE4MpobNF/wCeP6Mu+zaa9AlNxFKnr20ClPaj 0kYAn243TIM6fcwHel6CdnfEDB3YXDeZ
=UnKT
-----END PGP SIGNATURE-----
--
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.
Quoted 7 lines · Daniel J Walsh
I would like to patch libselinux to always return 0 on
avc_has_permif the machine is in permissive mode.This will allow Userspace Object Managers to work even if the system is totally mislabeled and processes as running with bad context. Currently if a program like dbus asks with a bad process label it can get denials even in permissive mode.
The patch seems like it could at least use a comment.
For reference the previous discussion was here:
http://marc.info/?l=selinux&m=123973525511476&w=2
I'm not opposed to the proposed patch, but ultimately while it will make their system not crash when in permissive, it also won't help much in getting people towards an enforcing system. It seems to me we need to improve:
1) The notification that the system requires a relabel. If terminals were HTML, we'd be using <blink>
2) The process of relabeling.
I think fixfiles defaulting to "all files on all mounted filesystems" is kind of wrong. We should only relabel things installed by RPM first, which should get you back to a clean slate for the system, then you can look at relabeling your custom web content, etc.
--
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.
Quoted 23 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 11 lines · Stephen Smalley
Quoted 10 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I would like to patch libselinux to always return 0 on
avc_has_permif the machine is in permissive mode.This will allow Userspace Object Managers to work even if the system is totally mislabeled and processes as running with bad context. Currently if a program like dbus asks with a bad process label it can get denials even in permissive mode.
Quoted 8 lines
Quoted 1 line
Does anyone see a problem with this?
I'm not fond of it. Permissive mode is just supposed to control whether permission is granted, not to hide other kinds of errors. Consider how difficult debugging of an actual failure will be if it only shows up in enforcing mode even though it has nothing to do with policy.
Quoted 5 lines
Well I guess I can only due the return in the
audit_has_permnot theaudit_has_perm_noaudit, since then the audit message will get generated but dbus,passwd,xserver ... will allow the access.If an app calls
audit_has_perm_noaudit, it will still return failure.
That doesn't help. The issue is that avc_has_perm can fail for reasons other than permission failure (which is why you are making this change), but those other reasons are not logged/audited, so if you make them succeed in permissive mode, then they won't be seen there. At all.
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.