-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload config on SELinux policy load #379
base: main
Are you sure you want to change the base?
Conversation
When a new SELinux policy is loaded the dbus config file it carries may have been updated as well. As such, we should reload the dbus configuration to catch any changes. This logic already exists in the dbus-daemon code and this change is largely based off of that code.
53ea1c4
to
f17d94e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Sadly, we cannot rely on the broker to have its controller as parent PID. So this either needs channeling via the controller interface, or we simply make the launcher listen for these events and trigger the reload from there (which I think is preferable).
*/ | ||
static int policy_reload_callback(int seqno) { | ||
pid_t ppid = getppid(); | ||
return kill(ppid, SIGHUP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The launcher/controller is not necessarily the parent PID. We need to pass this through the controller interface, just like the other activation related messages.
Thanks for the feedback, I am not very familiar with the broker code, so any input is more than welcome. I have tried to move the callback registration into launcher itself, but the actual callback method never seems to run. I am still digging into this but not making great progress. Could you possibly point me in the correct direction when you say "channeling via the controller interface" if setting up the callback in the launcher doesn't work out? |
I have dug more and have come up with the following: The reason why the launcher was not seeing the callback run and the broker was, is that the broker will call selinux_check_access which intern calls selinux_status_updated, which triggers the callback. The launcher has no such logic. As such I have come up with a few options for folks who know more than me to consider:
|
@dvdhrm Hi just a gentle ping about the proposed paths I laid out in my last comment. |
When a new SELinux policy is loaded, the dbus config file it carries may have been updated as well. As such, we should reload the dbus configuration to catch any changes. This logic already exists in the dbus-daemon code and this change is largely based off of that code.