Comments (8)
Thanks for the hint!
selinux_access_check()
resolves the contexts on every call. avc_has_perm()
allows us to cache the lookups by storing the sid pointers rather than the context-strings. Is this intentional?
from dbus-broker.
from dbus-broker.
If you are caching the security contexts I guess you should at least invalidate the cache if the policy is reloaded, see selinux_set_callback(3)
manpage (and SELINUX_CB_POLICYLOAD
)
from dbus-broker.
@bigon could you expand a bit on that? This is my understanding, please correct me if I'm wrong:
- The security context of a peer (which is the SO_SECLABEL of its socket) is pinned in the file description at open() and stays fixed regardless of any change to security policy.
- The SID returned by avc_context_to_sid() is valid for the lifetime of the daemon (we only call avc_destroy() when shutting down the daemon).
- We need to listen for SELINUX_CB_POLICYLOAD to reload the security contexts of names, and then obviously get a new SID if the context changes (we currently do not do this).
Are you saying that we also need to re-resolve all SIDs when the policy changes? Could we get a different SID back, even if the context is guaranteed to be the same?
from dbus-broker.
@teg I'm far from being an expert here, but I think that security context can be invalidated (the label become unlabeled_t
) when a module is disabled or a policy is updated. But the sid itself might still be valid.
For the original question from @doverride (avc_has_perm vs selinux_check_access) I guess this could be discussed on the SELinux from the NSA
from dbus-broker.
Lets just switch to selinux_check_access()
. Makes the code simpler, and we follow the upstream recommendation.
If this ends up slowing down the message bus considerably, we will need an upstream solution, anyway. Relying on deprecated interfaces sounds not right.
from dbus-broker.
Yeah, I'm fine with that.
from dbus-broker.
Fixed!
Thanks for the report!
from dbus-broker.
Related Issues (20)
- Can't locate expat HOT 2
- Wiki page minor correction HOT 2
- RFE: add destination/unit name to error messages HOT 5
- Error when enabling the service on Arch Linux HOT 4
- Invalid file in 'includedir' causes entire launch to fail HOT 4
- Integer overflow due to u64->u32 when passing the "limits" around (most likely happen to `max_bytes`) HOT 3
- dbus-broker-units has made Light Display Manager (lightdm) unable to start HOT 19
- With dbus-broker-units, the KDE (plasma) can't be loaded HOT 5
- Several Errors from dbus-broker-launch on linux boot | org.kde.dolphin.FileManager1.service' is not named after the D-Bus name 'org.freedesktop.FileManager1' HOT 6
- Running dbus-broker-launch without systemd (the reprise) HOT 5
- The default position of critical infrastructure cannot be complete system failure HOT 6
- Do not hard fail on a failed config parse in a manner which prevents the user from fixing it HOT 2
- How to replace dbus-broker as session bus? HOT 4
- dbus-broker uses an extremely high amount of memory HOT 2
- Error starting dbus-broker-launch HOT 5
- What are the field definitions for org.freedesktop.DBus.Debug.Status.UserAccounting HOT 2
- Test 48/49 libcstdaux-1failure with Clang HOT 1
- There seems to be a memory leak in policy_import
- RFE: improve dbus-broker's logging HOT 5
- Be able to set the servicedirs precedence HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbus-broker.