Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4071457ybb; Mon, 23 Mar 2020 12:57:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvpx8j7+8PvwALWo+aDSFrQJXamX0m3+sz4V4meKeroHCd/3EH4N4PXUNCH86bp6kZ4JxZZ X-Received: by 2002:aca:3101:: with SMTP id x1mr774058oix.15.1584993440000; Mon, 23 Mar 2020 12:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584993439; cv=none; d=google.com; s=arc-20160816; b=ue9LiAK9Sgo6DxYf9KmojrLtt5Kaw6RMQb2nLR5HWDpZH9uEl/HbbSUlAWUDE1rQxB xeVHTVpubUe243xfSQPIUd2FA4y3RrzJszQtZ1NsTaRuzvFmeQjprprRhEUcO1oIaQfl wGCqaDfjSbzGusNeV04Qg+g+tl0Ll2n6uQV3vcocHNH7k9JRme0aYqRZLnlrqFF0q1dz u73MLUtdKkdZ5Xhi1A024//m2dM3TE/MBFaU7h6IrFoQpFXnIl+DZNK7UOX3aW8a2V3s yp84Eo2kzeGoRPkevSjT+8w+iMm+wH/4nqqB8XLX7m82ql4JKqcb1HjlFhze+UF0n0cv kjdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=O7igelSqnZSzby+9Agw+dKmcrgK2R8ajZWmZKikiDho=; b=PLeUoTSfTD9IDYoFtiemOOJ4uPO8I2jpPbKhfl0WL6hIsJvN5owvcoRdPFeWNeOuHy tWmaMeiFmgJkjun1DMGSAMSBGm2BIRPU1Z0uQl2x+vNJ7Tt9SRhhmBdyQQNI11Ciabm4 3irIP3jsy1NUFBlr8em78p9k6ATiUn+VM4SJ1346Zqu7NLFdL6ESK0Zn8YqP/kRKX7qk SDMGmB/85HsYBs1AsKs2EUM3LjbIdzY8r2QWdx2kMfajKSc0YOlehSyac41Ls75XzTsv WBiy6SD6EiVjFRKc2jjwLpYW9cyHPSEoHZavsU4e0lwIq0vUMp0c2AvCtU/lrF/6jdBo WTFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZyQUyKFa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15si2787494otk.63.2020.03.23.12.57.07; Mon, 23 Mar 2020 12:57:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZyQUyKFa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727008AbgCWT4u (ORCPT + 99 others); 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-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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :) [...]