Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2360887rwd; Fri, 2 Jun 2023 08:22:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ny8JeL5KjJcpFFAkxHBPC6+AdNyAtR04I4GjDqLLcur1BjenJ1mQlH1F8r+tH3tKkx7P4 X-Received: by 2002:a17:90a:4c84:b0:253:3975:7a37 with SMTP id k4-20020a17090a4c8400b0025339757a37mr179288pjh.9.1685719374953; Fri, 02 Jun 2023 08:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685719374; cv=none; d=google.com; s=arc-20160816; b=EA/UIXXm+uv08KX46Z47yotH3tPo1N6wFirXefejYLjXpVQ3VWgvv8PYuwIqC2HwTf B6JIKNTcxODNlh+4XA+8g7x/uRZfwQZb7EpaEp0Wc4Wth9s0c7xpopK/oB2jth+LLXOS CL9pmWVLfHYzVMGYwdP6CUzkGiwuoug0v8gCmv0y9qgUsIFSEmQqj332oPtVp26FXeXl Lf33mBXgXiq6oORRkBUSSt0YGbSJbQiksqudAg62BZSzm6FsPJw1K55uGXDh8WWnvMDc m8vU3pvR8u1LRbDkvPU9YLahy6gg+riexZCiPqtk8+XLQes9hf3MAXRX3uJIQ6wp705H 3sdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GLlNdqI6axFbvYJKMCYGXuL8XXPH0s44RaNvUf/xb6U=; b=R84OTk77PjNe9CY2jwm4n1p/6wqsHYj63o6qmkbOG/qganXZdi5r/OL/5ueh5On57d eOCudi1bv1sKyGsEwPuA/UimzcyaGYqJID0NrjvgLtJ+1npb3zHygqGLajoZW7DVlLMG jG733D1RDCbJyCWfFyRQv1OOcQ7l0oLW4qx9z+PPQapjkcMOnd6jLTawzk1QqjteR6Zv VakRZnCIsmx+hVP0gLrjCErPbdSuxoWJZNyyAaXqIPs2P+5z7LhLpVnmdaE3SO2lUj/I DG18ytgNpa4Oa0seOeLDphpAEr7wS4pTnKc5TUifTgp3QqzoD0sgVMC9uH2WKOHWtGCX SqLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=A62jmKOB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a17090adc8300b00252e51a9fbasi1140257pjv.122.2023.06.02.08.22.40; Fri, 02 Jun 2023 08:22:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=A62jmKOB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236189AbjFBPPU (ORCPT + 99 others); Fri, 2 Jun 2023 11:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235446AbjFBPPQ (ORCPT ); Fri, 2 Jun 2023 11:15:16 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A16A136 for ; Fri, 2 Jun 2023 08:15:15 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b038064d97so26855675ad.0 for ; Fri, 02 Jun 2023 08:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; t=1685718915; x=1688310915; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GLlNdqI6axFbvYJKMCYGXuL8XXPH0s44RaNvUf/xb6U=; b=A62jmKOB1yFlTiUosWU7VYThESPApQWicsGL82YBY5HyRrCmBHSGxhtTsUd7cmxvFP FHVeE2Eg5YibxFL0i+3hqOEr0zDDsphcTMgN8Rn6pvDhWsUGMl5plNzEr9zsL6SpjRjJ RcyWzBtM0z8ZSV2dTIZYNnKCJ4EzHcTC29MBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685718915; x=1688310915; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GLlNdqI6axFbvYJKMCYGXuL8XXPH0s44RaNvUf/xb6U=; b=HibOCW/Uo2enJnDN9M+710M9GZuOIL/l2OVnUdge9M/3stOe7Zl5H36dhsJey8VzgU U/w/rSs6t83m4ONtaWIeMsoE8IKCDSRpFuXFc39VTK9WDkcwPaozKEW794W9uHLN/SFK T4GI6JKnnkcsMJE9GVZ3qE9zK86jViNWEm5pVnGOmdnhu/zeGLFHe6JWcYZYgrOHn8MJ 9990GadeumsqkU3CJlvPTDkPXZvL0KZta8KQeaRpMncBg3vzDXxLZU+fqoHA1q5QsqnH IyOzF5wFQ/iCwtNU/cZ34lWkO8CdHRVyGBG5rEh64REkD3M3enj/K6DmZqT7YGT1EhG0 53yQ== X-Gm-Message-State: AC+VfDzIi7MpnuBEzXwCKoj0SIcitBQ04Ec7tQy9D2PXX71xLcYWEcIt cSOVEbeeTjy0YB9+KRRg7fr3QzaIFyiZRCljifjCcg== X-Received: by 2002:a17:903:2449:b0:1ad:ea13:1914 with SMTP id l9-20020a170903244900b001adea131914mr61219pls.30.1685718914621; Fri, 02 Jun 2023 08:15:14 -0700 (PDT) MIME-Version: 1.0 References: <20230523181624.19932-1-ivan@cloudflare.com> In-Reply-To: From: Ignat Korchagin Date: Fri, 2 Jun 2023 16:15:03 +0100 Message-ID: Subject: Re: [PATCH] audit: check syscall bitmap on entry to avoid extra work To: Paul Moore Cc: Ivan Babrou , audit@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Eric Paris Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Fri, Jun 2, 2023 at 3:56=E2=80=AFPM Paul Moore wro= te: > > On Fri, Jun 2, 2023 at 7:08=E2=80=AFAM Ignat Korchagin wrote: > > On Thu, May 25, 2023 at 3:15=E2=80=AFAM Paul Moore wrote: > > > On Wed, May 24, 2023 at 2:05=E2=80=AFPM Ivan Babrou wrote: > > > > On Tue, May 23, 2023 at 7:03=E2=80=AFPM Paul Moore wrote: > > > > > > Could you elaborate on what exactly you would like to see added= ? It's > > > > > > not clear to me what is missing. > > > > > > > > > > I should have been more clear, let me try again ... > > > > > > > > > > From my perspective, this patch adds code and complexity to deal = with > > > > > the performance impact of auditing. In some cases that is the ri= ght > > > > > thing to do, but I would much rather see a more in-depth analysis= of > > > > > where the audit hot spots are in this benchmark, and some thought= s on > > > > > how we might improve that. In other words, don't just add additi= onal > > > > > processing to bypass (slower, more involved) processing; look at = the > > > > > processing that is currently being done and see if you can find a= way > > > > > to make it faster. It will likely take longer, but the results w= ill > > > > > be much more useful. > > > > > > > > The fastest way to do something is to not do it to begin with. > > > > > > While you are not wrong, I believe you and I are focusing on differen= t > > > things. From my perspective, you appear primarily concerned with > > > improving performance by reducing the overhead of auditing. I too am > > > interested in reducing the audit overhead, but I also place a very > > > high value on maintainable code, perhaps more than performance simply > > > because the current audit code quality is so very poor. > > > Unfortunately, the patch you posted appears to me as yet another > > > bolt-on performance tweak that doesn't make an attempt at analyzing > > > the current hot spots of syscall auditing, and ideally offering > > > solutions. Perhaps ultimately this approach is the only sane thing > > > that can be done, but I'd like to see some analysis first of the > > > syscall auditing path. > > > > Ivan is out of office, but I would like to keep the discussion going. > > We do understand your position and we're actually doing a project > > right now to investigate audit performance better ... > > That's great, thank you! > > > But the way I see it - the audit subsystem performance and the way how > > that subsystem plugs into the rest of the kernel code are two somewhat > > independent things with the patch proposed here addressing the latter > > (with full understanding that the former might be improved as well) ... > > You've done a good job explaining the reasoning and motivations behind > the patch submitted, that is good, but I'm not seeing any recognition > or understanding about the perspective I shared with you earlier. The > performance of audit in general does need to be improved, I don't > think anyone disagrees with that, but my argument is that we need to > focus on changes which not only reduce the processing overhead, but > *also* reduce the complexity of the code as well. Ah, sorry. You're right - I paid too much attention to performance and didn't quite read your concern about code complexity. But still, I think that code complexity improvements fall onto the implementation of the audit subsystem itself vs what we try to accomplish here is to improve the way how that subsystem plugs into the rest of the kernel. Ignat