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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS 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 78AD3C10DCE for ; Mon, 23 Mar 2020 19:56:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48A8220714 for ; Mon, 23 Mar 2020 19:56:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZyQUyKFa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725866AbgCWT4u (ORCPT ); Mon, 23 Mar 2020 15:56:50 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:44269 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbgCWT4u (ORCPT ); Mon, 23 Mar 2020 15:56:50 -0400 Received: by mail-qk1-f194.google.com with SMTP id j4so16688880qkc.11; Mon, 23 Mar 2020 12:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O7igelSqnZSzby+9Agw+dKmcrgK2R8ajZWmZKikiDho=; b=ZyQUyKFaEKEmFfsZZGGcpVLCY0rdoDcXD4zCVsS+DgCffo3uQdBYftPv9A3/cFjzvg JFKdIy5CKVRWPXrx59DJhXtz7S+IpYdEtq5rSdV8YO+GxrEDHDrjBXxjLWCV9k6HB15/ VNZYAgWnrLlcKLCTxwkco4cJvfXlv9tytCQJnd7l3sWGPcsgnyDf6OLck2xJtnU7Z9pp tPg+oJAwbEXvTBeWkKUfNu4LDfcvPJVOlsrN6wkrNsqly5Ajl6cpgp/R62a5m3bp7BlG /Eiu4kdXD6AYVl550u98b798SiNPPtnMetTIrLGAIcMDJRRatccFCKoVSe37lckkmXbl bjGw== 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=O7igelSqnZSzby+9Agw+dKmcrgK2R8ajZWmZKikiDho=; b=cMW7yionHRpEQNC3o9xeE5nPUqOs6OaWtQTdRei8DzzkQxnGU5LX/5rUchpnEXsRvh 9toGf05LyGOPFq9KnHyKZybncFMTt2tvHayKlhWtiP+yUrzP3sFJaaQpLSIcacqmp8BT 4b6AuLs3Fh6fa/iVkqr12wHbTh48VFlGSoNIBTWqkV4GFWY7oWfYRT2PbkoynkYv/qFn nXfqp1lkQbKpnqNl3NiWYnG2oTWdUVdGsYLVR8Us76uVQRqKNE2QgMDV+uGQK79zWXJH TMeNZQmSe2JWpjxpnb1mQEbpjKhY8CA3VHnyPNaJ0me5VGYVG2xIDBGfTrHnz2dbqMw7 vQNw== X-Gm-Message-State: ANhLgQ0OWJhhAr4OxVRvw/7gFkeO41zJE4Wzf/uEA+4oqkb6DPBG3shz nwTPhWzaq8wuxYP357/Cmym0gQJ6+pVBt2VQ8HI= X-Google-Smtp-Source: ADFU+vuNk+XojfkD2ANEtHWgonqRE45FobN+3bk7jLbXRujpqxIfFOz+ZhAN35zK9Cfgh1TYjbwqXMhx7RXBO8eHaQs= X-Received: by 2002:a37:992:: with SMTP id 140mr23091475qkj.36.1584993408656; Mon, 23 Mar 2020 12:56:48 -0700 (PDT) MIME-Version: 1.0 References: <20200323164415.12943-1-kpsingh@chromium.org> <20200323164415.12943-3-kpsingh@chromium.org> In-Reply-To: <20200323164415.12943-3-kpsingh@chromium.org> From: Andrii Nakryiko Date: Mon, 23 Mar 2020 12:56:37 -0700 Message-ID: Subject: Re: [PATCH bpf-next v5 2/7] security: Refactor declaration of LSM hooks To: KP Singh Cc: open list , bpf , linux-security-module@vger.kernel.org, Brendan Jackman , Florent Revest , Alexei Starovoitov , Daniel Borkmann , James Morris , Kees Cook , Paul Turner , Jann Horn , Florent Revest , Brendan Jackman , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: On Mon, Mar 23, 2020 at 9:45 AM KP Singh wrote: > > From: KP Singh > > The information about the different types of LSM hooks is scattered > in two locations i.e. union security_list_options and > struct security_hook_heads. Rather than duplicating this information > even further for BPF_PROG_TYPE_LSM, define all the hooks with the > LSM_HOOK macro in lsm_hook_names.h which is then used to generate all > the data structures required by the LSM framework. > > Signed-off-by: KP Singh > Reviewed-by: Brendan Jackman > Reviewed-by: Florent Revest > --- > include/linux/lsm_hook_names.h | 354 +++++++++++++++++++ > include/linux/lsm_hooks.h | 622 +-------------------------------- > 2 files changed, 360 insertions(+), 616 deletions(-) > create mode 100644 include/linux/lsm_hook_names.h > > diff --git a/include/linux/lsm_hook_names.h b/include/linux/lsm_hook_names.h > new file mode 100644 > index 000000000000..412e4ca24c9b > --- /dev/null > +++ b/include/linux/lsm_hook_names.h It's not really just hook names, it's full hook definitions, no? So lsm_hook_defs.h seems a bit more appropriate. Just for consideration, not that I care that strongly :) [...]