From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 890C3C4338F for ; Fri, 20 Aug 2021 19:06:48 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB60461057 for ; Fri, 20 Aug 2021 19:06:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EB60461057 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paul-moore.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-FrJI29ViNM6mgNbXxN-thA-1; Fri, 20 Aug 2021 15:06:43 -0400 X-MC-Unique: FrJI29ViNM6mgNbXxN-thA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AAF7FC73B3; Fri, 20 Aug 2021 19:06:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 05E58369A; Fri, 20 Aug 2021 19:06:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CF5564BB7C; Fri, 20 Aug 2021 19:06:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17KJ6Xiu013577 for ; Fri, 20 Aug 2021 15:06:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 53F0520BEAB6; Fri, 20 Aug 2021 19:06:33 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E91420C1753 for ; Fri, 20 Aug 2021 19:06:30 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B1269802A64 for ; Fri, 20 Aug 2021 19:06:30 +0000 (UTC) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-487-is9ynEyhMV29JrMTHm6m_g-1; Fri, 20 Aug 2021 15:06:28 -0400 X-MC-Unique: is9ynEyhMV29JrMTHm6m_g-1 Received: by mail-ej1-f52.google.com with SMTP id d11so22071370eja.8 for ; Fri, 20 Aug 2021 12:06:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q7x0Wnew5RknOSTO10okIRBDq0FR331ikFBd/KJhU7w=; b=ZmMCafBgU7pILM0IJ9Lb5UVlC2N782UeXqb5NvbbYlkhgfqpsjaz+ZG9BkOQ5iwg2r LyKclN+gj0EKs8KPeVTFTIlgRXob/co2u/L8Ej49LlMryLm5NQOlXU2bgsu0ad5k4QCy OEgO4toA6GXNTa2zbpzbgi30YinNnT4c5NpGjE6ItkMMIYQOGMQknbk/XdTZ68TDRDBt 9aUSBR28JERTDTXbnbBBPQAG+WkeuNjcWvuna2HeUHroQDpoKsNrI8w//wQKQtnK1roM 6aJ3wuU23XWKqQd8e33fpC0NH1K5fP1GXyEcw32OqyU5zsXZ0tR/1rCCSXme6w+gxB9C mVQQ== X-Gm-Message-State: AOAM530Ew0LiNWQqs7DtpfqRcKKtIoKfLOMTNpwdBtMgX8zK7O1nZyXZ vbehgE0eKzFPrYcuCyHCTzsVenlT5JtQbOTY47e2 X-Google-Smtp-Source: ABdhPJwuDhsnxNJYKIJdPMBi1jGG0b+kJyGeIdr1cU2IvPwA6WANdxklzKLtMSlx2+JNzX6LuQwaPAl1YCQ+kn0RCpU= X-Received: by 2002:a17:906:488a:: with SMTP id v10mr22887812ejq.91.1629486386535; Fri, 20 Aug 2021 12:06:26 -0700 (PDT) MIME-Version: 1.0 References: <20210722004758.12371-1-casey@schaufler-ca.com> <20210722004758.12371-23-casey@schaufler-ca.com> <3ebad75f-1887-bb31-db23-353bfc9c0b4a@schaufler-ca.com> <062ba5f9-e4e8-31f4-7815-826f44b35654@schaufler-ca.com> <6f219a4d-8686-e35a-6801-eb66f98c8032@schaufler-ca.com> In-Reply-To: <6f219a4d-8686-e35a-6801-eb66f98c8032@schaufler-ca.com> From: Paul Moore Date: Fri, 20 Aug 2021 15:06:15 -0400 Message-ID: Subject: Re: [PATCH v28 22/25] Audit: Add record for multiple process LSM attributes To: Casey Schaufler X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: linux-audit@redhat.com Cc: john.johansen@canonical.com, selinux@vger.kernel.org, James Morris , linux-security-module@vger.kernel.org, linux-audit@redhat.com, casey.schaufler@intel.com, Stephen Smalley X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, Aug 19, 2021 at 6:41 PM Casey Schaufler wrote: > On 8/18/2021 5:56 PM, Casey Schaufler wrote: > > On 8/18/2021 5:47 PM, Paul Moore wrote: > >> ... > >> 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? > > > > Nope. Sorry. > > It looks as if all of the NULL audit_context cases are for either > auditd or systemd. Given what the events are, this isn't especially > surprising. I think we may be back to the "early boot" theory. Unless you explicitly enable audit on the kernel cmdline, e.g. "audit=1", processes started before userspace enables audit will not have a properly allocated audit_context; see the "if (likely(!audit_ever_enabled))" check at the top of audit_alloc() for the reason why. I could be wrong here, but I suspect if you add "audit=1" to your kernel command line those remaining cases of NULL audit_contexts will resolve themselves. If not, we still have work to do ... well, I mean we still have (different) work to do even if this solves the mystery, it's just that we can now explain what you are seeing :) -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit