Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4717995ioa; Wed, 27 Apr 2022 09:34:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+jBK0OuYpei9l3Htmvgq8hElX3yJTn/VJHgAch87qCir5jHj/vRk8CuuXYXfjpOs2FIMV X-Received: by 2002:a62:e80f:0:b0:50d:3693:43df with SMTP id c15-20020a62e80f000000b0050d369343dfmr19514374pfi.36.1651077258398; Wed, 27 Apr 2022 09:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651077258; cv=none; d=google.com; s=arc-20160816; b=dYlJmPT3oMgz9KZpRJYcwyD3lYg9DO8Oi4WPhCUMK5SSTSKFX8M0z0ahiexHwwf04Y JQvuH7EP8fGmBYGx2wCtYdMsLGlil24DXQInxCt6TGfASC8k4Ejm/YOVlTTHKrAOaU7X Aaik88Josfz/EyLsTCbY1cGANTi5uTW8yZ9wEgoqf+dNAb68u3bvh7uDSllslEJQmpEl lgxlGq5YDJxOIlsTAlf6i/PLv2s+FixJ+E0Yjk+N3HwR//knsh67rfGZR3N4oxLf5XM6 IObEOa/13D1oucU/DV10TI296f0vqPGpN6nG+ajNA5niKJzmZWGTy7s9j1HtUHb+jA/x t64A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tuXdH3mbYd4Gnl44e//+j/klraKOvkpgOliwGw+YZ7s=; b=lAeyYcL3RAe0zyU4XTr4QWdNiURTU7yVbTL7epf/Lx3WWMXjEPDYe8tcHYXuQN4ZYf nQZmS3KmIvT3PTxfUPC9ALcMleIASK4S0bYCdpInjpDawMoV/YKLFkwhW4XZsYOKRmaa NADvWeQyBqvI3ApFPWtCb5ouCeUNk9xNs5TwEQWHeIOjN8CvgNxsxQph1cVPLBznkbAz 6QEMTHm6crq3/epIKrSXn4sI994gVwbq7d9z9c47tzc2N9K8skZQ8i6QkSaiFzLFWW4v F11faEAbr30sAXeRcu6QnoAgvsDllTl06A3pVkvqbFELmDrY9NVRCcSpRMPtCxgkqYkZ b9NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b="BnT4/TnG"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h8-20020a170902f54800b00153b2d16556si2181800plf.350.2022.04.27.09.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 09:34:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b="BnT4/TnG"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D717B3EDA94; Wed, 27 Apr 2022 09:04:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241525AbiD0QGn (ORCPT + 99 others); Wed, 27 Apr 2022 12:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243373AbiD0QFw (ORCPT ); Wed, 27 Apr 2022 12:05:52 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AFBC3C305F for ; Wed, 27 Apr 2022 09:02:34 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id q23so3178692wra.1 for ; Wed, 27 Apr 2022 09:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tuXdH3mbYd4Gnl44e//+j/klraKOvkpgOliwGw+YZ7s=; b=BnT4/TnG/yQ41vtWz0BFedhJxhOAqjpLvHN9LNyXhyV8m+8PnZpCz0iC3bfWLFc8PQ Jxw2c4EagSdCNgndlDqapohrwulYpJAwBMaP3C6yZpshJxRG6Sd92TyOVPOVZloVMfo1 grZekdjRWmzxzm7BLam6dnAFrfMnghKS5GrLT32H8wSh5EbfG+4gXEvNzkcpEwnMqrk6 sUCctJvhvEeGZJXctjBr06vKK30nynGDVRhNXBjTLUBENOBiXnKBsX0DmtPbi6Mwi5Rs JEnp1p5+QxWZusg6F/RzyB1pyHNHvhIymslg5vMAabB6TXqTlwYj2F5oMN9pM3f1trzw p5dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tuXdH3mbYd4Gnl44e//+j/klraKOvkpgOliwGw+YZ7s=; b=UmeB2g4Dx4WB1Ek4oGmlcXhi8CsbJYWEHCoFcnJkhHcm6dDFfo7wHQf2A1UpHFAV/G AIy9Wh5xKTcSe2WSNiqQCyH2WQ6Ba0GHseObjIpjhgVPiCNUdPs1kft7R7g9TsK7q953 3cSMUlp62jLSBWz+63CFJ/8LfCHOpWHeKgnK/o+Gvb8kenIe1PyseAK3PWlWYS7eC2O9 yi3XzteOnaxnCbxzypdXTxZi3k7JyBZGfSpGlU6cM9HUSyVJ8UF3UDEnTUfn+RG4V2c3 WpeUqHqR5/Sk8qIVh88RHYs+dILALZXQ2dPV7h2cTFJZdG8OMXoCqd+Z7OZFr8putZ04 9mnw== X-Gm-Message-State: AOAM533zyviVhz+Zzhk2azHzxOyQtLVRoIZAw6deliQLiuDIQjxzTSYu 4LwdQ4czBgYpoSBwEykjLVAqhNyqb5LrAfYfnWv5 X-Received: by 2002:a5d:590d:0:b0:20a:c3eb:2584 with SMTP id v13-20020a5d590d000000b0020ac3eb2584mr22239195wrd.18.1651075352543; Wed, 27 Apr 2022 09:02:32 -0700 (PDT) MIME-Version: 1.0 References: <20220418145945.38797-1-casey@schaufler-ca.com> <20220418145945.38797-24-casey@schaufler-ca.com> <26eca0aa-111a-9473-8925-e4b12cadbd79@canonical.com> <4ec176c6-1f66-3951-f40f-1eb0d5b66a09@schaufler-ca.com> In-Reply-To: <4ec176c6-1f66-3951-f40f-1eb0d5b66a09@schaufler-ca.com> From: Paul Moore Date: Wed, 27 Apr 2022 12:02:21 -0400 Message-ID: Subject: Re: [PATCH v35 23/29] Audit: Create audit_stamp structure To: Casey Schaufler Cc: John Johansen , jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-audit@redhat.com, keescook@chromium.org, penguin-kernel@i-love.sakura.ne.jp, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 27, 2022 at 11:49 AM Casey Schaufler wrote: > > On 4/26/2022 12:18 PM, Paul Moore wrote: > > On Tue, Apr 26, 2022 at 2:58 PM John Johansen > > wrote: > >> On 4/26/22 11:03, Paul Moore wrote: > >>> On Mon, Apr 25, 2022 at 7:31 PM John Johansen > >>> wrote: > >>>> On 4/18/22 07:59, Casey Schaufler wrote: > >>>>> Replace the timestamp and serial number pair used in audit records > >>>>> with a structure containing the two elements. > >>>>> > >>>>> Signed-off-by: Casey Schaufler > >>>>> Acked-by: Paul Moore > >>>>> --- > >>>>> kernel/audit.c | 17 +++++++++-------- > >>>>> kernel/audit.h | 12 +++++++++--- > >>>>> kernel/auditsc.c | 22 +++++++++------------- > >>>>> 3 files changed, 27 insertions(+), 24 deletions(-) > >>> ... > >>> > >>>>> diff --git a/kernel/audit.h b/kernel/audit.h > >>>>> index 4af63e7dde17..260dab6e0e15 100644 > >>>>> --- a/kernel/audit.h > >>>>> +++ b/kernel/audit.h > >>>>> @@ -108,10 +114,10 @@ struct audit_context { > >>>>> AUDIT_CTX_URING, /* in use by io_uring */ > >>>>> } context; > >>>>> enum audit_state state, current_state; > >>>>> + struct audit_stamp stamp; /* event identifier */ > >>>>> unsigned int serial; /* serial number for record */ > >>>> shouldn't we be dropping serial from the audit_context, since we have > >>>> moved it into the audit_stamp? > >>> Unless we make some significant changes to audit_log_start() we still > >>> need to preserve a timestamp in the audit_context so that regularly > >>> associated audit records can share a common timestamp (which is what > >>> groups multiple records into a single "event"). > >>> > >> sure, but the patch changes things to use ctx->stamp.serial instead of > >> ctx->serial ... > > My apologies, I read your original comment wrong; I was thinking you > > were suggesting removing the timestamp info from audit_context in > > favor of using the timestamp info contained in the audit_buffer. > > > > Yes, audit_context:serial is no longer needed with audit_context:stamp. > > Thank you for catching that. Easy (I expect) fix. > BTW, I'm not supposed to be working the next few weeks, > but I should be able to sneak v36 in before the next merge > window. Enjoy the time away :) FWIW, this isn't my call to make, but I would strongly prefer if this got a *full* run in linux-next before it was merged into Linus' tree during the merge window. For example, get this into the LSM -next tree at -rc1 instead of -rc6. -- paul-moore.com