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=-16.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 5B791C433E3 for ; Mon, 13 Jul 2020 17:55:36 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C010120738 for ; Mon, 13 Jul 2020 17:55:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C010120738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-audit-bounces@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-221-MseXRMrgPaiiIUWjc69qIA-1; Mon, 13 Jul 2020 13:55:31 -0400 X-MC-Unique: MseXRMrgPaiiIUWjc69qIA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E487C1083E80; Mon, 13 Jul 2020 17:55:27 +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 7CDD52B6DD; Mon, 13 Jul 2020 17:55:27 +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 056DE180954D; Mon, 13 Jul 2020 17:55:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06DHtOLD006849 for ; Mon, 13 Jul 2020 13:55:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE2971003213; Mon, 13 Jul 2020 17:55:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9829110F0D4 for ; Mon, 13 Jul 2020 17:55:22 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A35B885A5B3 for ; Mon, 13 Jul 2020 17:55:22 +0000 (UTC) Received: from sonic303-27.consmr.mail.ne1.yahoo.com (sonic303-27.consmr.mail.ne1.yahoo.com [66.163.188.153]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-fMOf5jJfN4y7dXVUj1dDVA-1; Mon, 13 Jul 2020 13:55:20 -0400 X-MC-Unique: fMOf5jJfN4y7dXVUj1dDVA-1 X-YMail-OSG: bKnJmOMVM1my.jCawu6y_Lomj6dzXwFo8j6UHoF2tsIuUEQLfq1DktZ1Uo6IlyW 2tZue4s.yyzkBBMQGWeDj4bRxuKgTXJKu95uIZ895HjnChr3j5FbIVQYCFflE6OSorTD7Ukvi46Q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2hq3ya.snswLmIIcl6XhPcQU9_5KnTBt6_3.seW8u9V8aRpD8VNWnvQiwCFx8O 6OUPFxuhRtlw.yyHeDoZeYHqavon2TYWdkl8NCiNWfNw6XS28jB_WfaoeIRvaqzc5_vC1QJPR0ae BhG6nzwH9UY9v7AX6R6fvEmQfuNRwXscVAzF1_6L_A4lo_2hYM0U818RiPy.H_Oc.95uSIAC0i8C Vl7P3VgkBvJpg Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Mon, 13 Jul 2020 17:55:19 +0000 Received: by smtp417.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID bffaaba8296e76c3e8da4b6627fa77a8; Mon, 13 Jul 2020 17:55:15 +0000 (UTC) Subject: Re: [PATCH ghak122 v1] audit: store event sockaddr in case of no rules To: Richard Guy Briggs , Paul Moore References: <20200713174014.mjsdugomgjtl3kgz@madcap2.tricolour.ca> From: Casey Schaufler Autocrypt: addr=casey@schaufler-ca.com; keydata= mQINBFzV9HABEAC/mmv3jeJyF7lR7QhILYg1+PeBLIMZv7KCzBSc/4ZZipoWdmr77Lel/RxQ 1PrNx0UaM5r6Hj9lJmJ9eg4s/TUBSP67mTx+tsZ1RhG78/WFf9aBe8MSXxY5cu7IUwo0J/CG vdSqACKyYPV5eoTJmnMxalu8/oVUHyPnKF3eMGgE0mKOFBUMsb2pLS/enE4QyxhcZ26jeeS6 3BaqDl1aTXGowM5BHyn7s9LEU38x/y2ffdqBjd3au2YOlvZ+XUkzoclSVfSR29bomZVVyhMB h1jTmX4Ac9QjpwsxihT8KNGvOM5CeCjQyWcW/g8LfWTzOVF9lzbx6IfEZDDoDem4+ZiPsAXC SWKBKil3npdbgb8MARPes2DpuhVm8yfkJEQQmuLYv8GPiJbwHQVLZGQAPBZSAc7IidD2zbf9 XAw1/SJGe1poxOMfuSBsfKxv9ba2i8hUR+PH7gWwkMQaQ97B1yXYxVEkpG8Y4MfE5Vd3bjJU kvQ/t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ExMsz+rUl1H icmcmpptCwOSgwSpPY1Zfio6HvEJp7gmDwMgozMfwQuT9oxyFTxn1X3rn1IoYQF3P8gsziY5 qtTxy2RrgqQFm/hr8gM78RhP54UPltIE96VywviFzDZehMvuwzW//fxysIoK97Y/KBZZOQs+ /T+Bw80Pwk/dqQ8UmIt2ffHEgwCTbkSm711BejapWCfklxkMZDp16mkxSt2qZovboVjXnfuq wQ1QL4o4t1hviM7LyoflsCLnQFJh6RSBhBpKQinMJl/z0A6NYDkQi6vEGMDBWX/M2vk9Jvwa v0cEBfY3Z5oFgkh7BUORsu1V+Hn0fR/Lqq/Pyq+nTR26WzGDkolLsDr3IH0TiAVH5ZuPxyz6 abzjfg== Message-ID: <9ec00f40-e7e9-950e-4ed9-48533a9ee223@schaufler-ca.com> Date: Mon, 13 Jul 2020 10:55:15 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200713174014.mjsdugomgjtl3kgz@madcap2.tricolour.ca> Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: linux-audit@redhat.com Cc: Eric Paris , Linux-Audit Mailing List 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.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 7/13/2020 10:40 AM, Richard Guy Briggs wrote: > On 2020-07-08 18:49, Paul Moore wrote: >> On Fri, Jul 3, 2020 at 1:18 PM Richard Guy Briggs wrote: >>> When there are no rules present, the event SOCKADDR record is not >>> generated due to audit_dummy_context() generated at syscall entry from >>> audit_n_rules. Store this information if there is a context present to >>> store it so that mandatory events are more complete (startup, LSMs...). I don't know for sure, but this looks a lot like the issues I have had to address for LSM stacking in [PATCH v18 20/23] Audit: Add new record for multiple process LSM attributes I don't know if the approach I took will help here, or be acceptable at all for that matter. But it might be worth taking a look. >>> >>> Please see the upstream issue >>> https://github.com/linux-audit/audit-kernel/issues/122 >>> >>> Signed-off-by: Richard Guy Briggs >>> --- >>> Passes audit-testsuite. >>> >>> include/linux/audit.h | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> Do we have any certification requirements driving this change? I ask >> because if we make this change, why not do the same for PATH records? > I filed the issue because I noticed the SOCKADDR record missing from > configuration events required for certification. > >> The problem of course is that doing this for both is going to be >> costly, the PATH records in particular seem like they would raise a >> performance regression. > I had a minor concern about performance for SOCKADDR. I filed SOCKADDR > because I noticed it missing, but intended to file others as noticed. > > I agree the PATH records would have a larger performance concern, but if > they are required to support event records that are required for > certification then either we store them when the context is present or > generate them retroactively once a required event record is generated. > > In the case of SOCKADDR it may be possible to store that information > once the required record has been generated rather than whenever there > is a valid audit context, but it is currently collected earlier than > config records are emitted. > >> I agree it would be nice to have this information, but I fear that >> gating this on audit_dummy_context() is the right thing to do unless >> there is a strong requirement that we always record this information. > That would have been great feedback when the issue was filed. > However, there may be a middle ground as descirbed above. > >>> diff --git a/include/linux/audit.h b/include/linux/audit.h >>> index 03c4035a532b..07fecd99741a 100644 >>> --- a/include/linux/audit.h >>> +++ b/include/linux/audit.h >>> @@ -448,7 +448,7 @@ static inline int audit_socketcall_compat(int nargs, u32 *args) >>> >>> static inline int audit_sockaddr(int len, void *addr) >>> { >>> - if (unlikely(!audit_dummy_context())) >>> + if (audit_context()) >>> return __audit_sockaddr(len, addr); >>> return 0; >>> } >> paul moore > - RGB > > -- > Richard Guy Briggs > Sr. S/W Engineer, Kernel Security, Base Operating Systems > Remote, Ottawa, Red Hat Canada > IRC: rgb, SunRaycer > Voice: +1.647.777.2635, Internal: (81) 32635 > > -- > Linux-audit mailing list > Linux-audit@redhat.com > https://www.redhat.com/mailman/listinfo/linux-audit > -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit