On Wed, Aug 18, 2021 at 5:59 PM Casey Schaufler <casey@xxxxxxxxxxxxxxxx> wrote: > > On 8/16/2021 11:57 AM, Paul Moore wrote: > > On Fri, Aug 13, 2021 at 5:47 PM Casey Schaufler <casey@xxxxxxxxxxxxxxxx> wrote: > >> On 8/13/2021 1:43 PM, Paul Moore wrote: > ... > > Yeah, the thought occurred to me, but we are clearly already in the > > maybe-the-assumptions-are-wrong stage so I'm not going to rely on that > > being 100%. We definitely need to track this down before we start > > making to many more guesses about what is working and what is not. > > I've been tracking down where the audit context isn't set where > we'd expect it to be, I've identified 5 cases: > > 1000 AUDIT_GET - Get Status > 1001 AUDIT_SET - Set status enable/disable/auditd > 1010 AUDIT_SIGNAL_INFO > 1130 AUDIT_SERVICE_START > 1131 AUDIT_SEVICE_STOP > > These are all events that relate to the audit system itself. > It seems plausible that these really aren't syscalls and hence > shouldn't be expected to have an audit_context. I will create a > patch that treats these as the special cases I believe them to be. Yes, all but two of these could be considered to be audit subsystem control messages, but AUDIT_SERVICE_{START,STOP} I think definitely fall outside the audit subsystem control message category. The AUDIT_SERVICE_{START,STOP} records are used to indicate when a service, e.g. NetworkManager, starts and stops; on my fedora test system they are generated by systemd since it manages service state on that system; a quick example is below, but I'm sure you've seen plenty of these already. % ausearch -m SERVICE_START time->Wed Aug 18 20:13:00 2021 type=SERVICE_START msg=audit(1629331980.779:1186): pid=1 uid=0 auid=4294967295 s es=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=NetworkManager-dispatch er comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? re s=success' However, regardless of if the message is related to controlling the audit subsystem or not, we do want to be able to associate those records with other related records, e.g. SYSCALL records. Looking at the message types you listed above, they are all records that are triggered by userspace via netlink messages; if you haven't already I would start poking along that code path to see if something looks awry. I just spent a few minutes tracing the code paths up from audit through netlink and then through the socket layer and I'm not seeing anything obvious where the path differs from any other syscall; current->audit_context *should* be valid just like any other syscall. However, I do have to ask, are you only seeing these audit records with a current->audit_context equal to NULL during early boot? -- paul moore www.paul-moore.com