Description of problem: Systemd is sending this event on selinux policy update: type=USER_AVC msg=audit(1424436728.229:7283): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc: received policyload notice (seqno=2) exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?' This is completely the wrong thing to do. First, it should be a USER_MAC_POLICY_LOAD event. Example event can be found here: http://selinuxproject.org/page/NB_AL#General_SELinux_Audit_Events
Created attachment 994568 [details] untested patch to fix the issue Does this patch (only compile tested) look like it does the right thing?
Looking at the patch, I don't know where type gets set. It should be getting set to AUDIT_USER_MAC_POLICY_LOAD. I also don't know what the content of buffer holds. Can you trigger a policy reload and paste the event in here? That would be very helpful. Also, thanks for quick turn around on this. Its very much appreciated. (I've been out on PTO lately.)
Comment on attachment 994568 [details] untested patch to fix the issue This patch was wrong... Basically, libselinux is designed so that all event types are logged using the same logging callback. There is a type parameter (SELINUX_AVC, SELINUX_INFO, SELINUX_WARNING, SELINUX_ERROR), but it does not map to audit event types in any way that I can see. E.g. checks are logged using SELINUX_INFO and SELINUX_AVC if there's a denial, policy reloads are logged using SELINUX_INFO, etc. Since we always needs to specify an audit event type when logging to audit, we could either use the same audit event type for all events, or make one up, or not log to audit at all, or maybe log to audit only SELINUX_AVC events. Currently we are using option one, and it seems to be the best option, because it gives us working audit logging, albeit with wrong event codes. I'm inclined to close this as CANTFIX, unless you have an idea how to implement this differently.
For example, the log line from comment #c1 comes straight from libselinux: avc_log(SELINUX_INFO, "%s: received policyload notice (seqno=%u)\n", avc_prefix, msg->seqno); The is no way to map this back to USER_MAC_POLICY_LOAD in the logging callback.
I'd suggest not using libselinux to do this and use audit_log_user_message() instead.
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Apparently X is doing something similar to properly set the type of the event: http://cgit.freedesktop.org/xorg/xserver/tree/Xext/xselinux_hooks.c#n300
I've posted a question on the selinux mailing list to have their opinion: https://marc.info/?l=selinux&m=144682738423855&w=2 ==== From: Stephen Smalley <sds () tycho ! nsa ! gov> I think when they introduced the audit support, they should have added a new type value in libselinux for MAC_POLICY_LOAD, and then they could have handled this cleanly in their callback functions. That is what I would do. I guess now we have to figure out how to do so compatibly... ===
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle. Changing version to '24'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
problem still exists.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Problem still exists
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle. Changing version to '30.
This message is a reminder that Fedora 30 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '30'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 30 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.