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=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 BB679C4338F for ; Fri, 20 Aug 2021 23:52:06 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 1AC32611AE for ; Fri, 20 Aug 2021 23:52:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1AC32611AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.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-38-ARw5oQ_0MYCQq3J2oFBUAw-1; Fri, 20 Aug 2021 19:52:03 -0400 X-MC-Unique: ARw5oQ_0MYCQq3J2oFBUAw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9E4B190A7A2; Fri, 20 Aug 2021 23:51:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BFC4226E7; Fri, 20 Aug 2021 23:51:59 +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 2F391181A100; Fri, 20 Aug 2021 23:51:57 +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 17KNmicT002826 for ; Fri, 20 Aug 2021 19:48:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB7E02087457; Fri, 20 Aug 2021 23:48:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C643F2087452 for ; Fri, 20 Aug 2021 23:48:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 ACF90101A529 for ; Fri, 20 Aug 2021 23:48:41 +0000 (UTC) Received: from sonic314-27.consmr.mail.ne1.yahoo.com (sonic314-27.consmr.mail.ne1.yahoo.com [66.163.189.153]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-529-zcW_TmoeMv-IR0i1wWmFeg-1; Fri, 20 Aug 2021 19:48:39 -0400 X-MC-Unique: zcW_TmoeMv-IR0i1wWmFeg-1 X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1629503318; bh=VhEqJ7bhPxejGMOeycnqUMW1pbnLstX6znl9HYOcx5D=; h=X-Sonic-MF:Subject:To:From:Date:From:Subject; b=aG88CV+43MrnGR4pOGkDBjVjCJ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F4ZzJMFSJQSn18kKDowex0zWTZccFP1zFHBFrtsYsnQn.DrOyL3IXEZvOEPg9wF GnSx0TRW4BByQDKIOCH2qUWLWPWLJhboGwwoPpEwgW.hrB_q8EcLRA71gWy4gXOmIdev7nBAV.Jy 9BcCsEt1sfV8Z.XznGxgoPE8wyfP1MQfWl_2YU3UG9AavJAXPfYJgyw51W8KuhxjAWXrTc7OxshN digHwJXwRM6jOAlZXR20KVoWw0fCRygwRcePIngegJeed2tYDsZn7dQpaDeqPFpnK1RevXrvWLr6 UPi048vIpbIni7VDRo0Bc3YP2DPwnwqhe9gTbeAisn83lIFhOFvL_dxNSOAUL5jjBRJF4ejdwfiC SXeQPwVk2CQVSJ.MVOsFedsF3a7inTPOVA6K_P7BClKXvxzzIV.H2ZY0LYBjE46NxTni5aLM.L1G 26NAnk_EH7TY83N8M3DR_u5M2OBFNXLaLMCOqbMLL95LMKAtvSZCwJzN5JvG7d7TdZZX14M4SXJW e91ut9W6xk6q3q4S8X0ozi.spkE1bGPZlaCFeWL9_I44bde_lbMK3x.O0XFqjqQ-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Fri, 20 Aug 2021 23:48:38 +0000 Received: by kubenode534.mail-prod1.omega.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID a5c7f9da00d3aa0016b48f9364e6fb8f; Fri, 20 Aug 2021 23:48:37 +0000 (UTC) Subject: Re: [PATCH v28 22/25] Audit: Add record for multiple process LSM attributes To: Paul Moore 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> <93d97b1e-d3ea-0fe0-f0c2-62db09d01889@schaufler-ca.com> From: Casey Schaufler Message-ID: Date: Fri, 20 Aug 2021 16:48:35 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <93d97b1e-d3ea-0fe0-f0c2-62db09d01889@schaufler-ca.com> 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-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 17KNmicT002826 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.13 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-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 8/20/2021 12:17 PM, Casey Schaufler wrote: > On 8/20/2021 12:06 PM, Paul Moore wrote: >> 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 found a hack-around that no one will like. I changed that check to be (likely(!audit_ever_enabled) && !lsm_multiple_contexts()) It probably introduces a memory leak and/or performance degradation, but it has the desired affect. >> >> 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 :) > Yup, adding "audit=1" to the command line appears to have gotten > systemd an audit context. It looks like user space enabling audit > doesn't assign an audit context to the existing systemd process. > -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit