Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5000879ybb; Tue, 24 Mar 2020 09:08:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuKS8XD1DiUaUt/Woxkk8g/RjrLUcqdVz9eKH4Dr+SlCA5Yu2F0gYP17XyacjbVARewPWfe X-Received: by 2002:a05:6808:16:: with SMTP id u22mr3982224oic.127.1585066105867; Tue, 24 Mar 2020 09:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585066105; cv=none; d=google.com; s=arc-20160816; b=RYr6/H3M5LirJ3Cv4SxFpoOGDR1RSJapSqTZDZPuMq17nX4c7RlHMfmvqO2zckPiEO HZxBsT4iwTU9rUn6gOHChj1pMB6qP3z1/Lrz+KUfai1q24o76p/tWBxXjS4Uk66wW1Hc sCF4rB+uMj2vkmwe3mI/8ep7rwI2x9Mp+ozgIaHwyNYdaG7ocnCJJUkHH7CJofJKAsHv Hxr5TCOaxcFq9JpmLp+O6GIHTKwyc2kPBTjoduEu7uQYgwvBUyJbrl+05SLX7JJrtEH8 CZgu8RZIAl+RWefRHJbKf4+Y5XcIfptSo/NN2BMsbqM1Vr28KSpamMGg0+7jA45V/ehl /6wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=1N/kkCsXiaUZJR6Cb6g+LjBhvjr5lmjI4mokCR0tVqI=; b=VEF5iHwNqL//0MSlwDhReSvVtnGziGv3Sty005gsfZYveZ/zkhptUb6V3eWrDa9IP2 mp28VObqogzc44kmaCEaI9zbYzgmhznBL85/RFzbzIUt7pSU189JMUkRZU7wnuQiLrVo 6kYT/qa42rlDc2DaNYspkyxZ3F0RQATAD57HqqrNi3VukJ3eW4zAfyKnOlovW//iL89E CseqBo1dAGe7NNUezjb8LX/Bk9b5Kgf2PI3HNXvCXC5ixPHHQ8LF7u5wlZYNyKWq26lw bbEX/y+vRjpTTLPJsVXMq+AxqIBFgIQ4S/PitG5Q9xBXAqtOg3Dj6x4cmrSZZzLMVBLD 9wUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KYQKDx8D; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c20si2363718otr.39.2020.03.24.09.08.11; Tue, 24 Mar 2020 09:08:25 -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=@chromium.org header.s=google header.b=KYQKDx8D; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727877AbgCXQGX (ORCPT + 99 others); Tue, 24 Mar 2020 12:06:23 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55800 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727426AbgCXQGW (ORCPT ); Tue, 24 Mar 2020 12:06:22 -0400 Received: by mail-wm1-f66.google.com with SMTP id v25so1977310wmh.5 for ; Tue, 24 Mar 2020 09:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=1N/kkCsXiaUZJR6Cb6g+LjBhvjr5lmjI4mokCR0tVqI=; b=KYQKDx8DyzUAnuq2yoc8TeWYg6u2d9G1EnJpysHS23i/nJtDUTJ1EGMDA+yLtc+3Ne ttb5axfZ4dXbmiVTOnc+IEEDAk9zxj2cXn99YKJpGZc93ZuBmxvzsUq8qH6oTtP5O3Yq fGk1pmxtTvy5X+ioEB3lY2DmwDertoipWkA38= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=1N/kkCsXiaUZJR6Cb6g+LjBhvjr5lmjI4mokCR0tVqI=; b=AnyaeRUnuPga5dKVNe1j1Jz02fEHLHKI7CaGBVXt4O1QdSH/ekpMzV77A+IuAJOv2D n9WGb5GPdac1jlGHSu57w8W8fUKwXK0QdXePB1ZuTR1+JW4uu8Dx0z1UJTMJlEVEJ3r+ 0MybxMxfh5rVBOMF1V9sDvSWb+7oUpaAVTzSo3vNxXgBIkbpB4n8KQUsY/DNJQTPUFcX jjBwL19meCdW2Ci6DQ4DcTIYGItEBC7FLtLdDU1fEd1dNd1FW3jon1J9SV2NfR6nNGy1 5czi9669xbO0uZ+wmpExWvs/yuXFDRqwk/sE24GFE1YQQVL7Yfw8/STY0q2gMuI/aop9 eH/w== X-Gm-Message-State: ANhLgQ1Rus+QFfwCC7Y93Wsb/My6Ak4bPAqymIEJSbhCOQodgc9t10sp ax07FrQvmK+GUDZB4w3bolET5Q== X-Received: by 2002:a7b:cf19:: with SMTP id l25mr6240257wmg.131.1585065980936; Tue, 24 Mar 2020 09:06:20 -0700 (PDT) Received: from chromium.org (77-56-209-237.dclient.hispeed.ch. [77.56.209.237]) by smtp.gmail.com with ESMTPSA id u204sm4887603wmg.40.2020.03.24.09.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 09:06:18 -0700 (PDT) From: KP Singh X-Google-Original-From: KP Singh Date: Tue, 24 Mar 2020 17:06:16 +0100 To: Andrii Nakryiko 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 Subject: Re: [PATCH bpf-next v5 2/7] security: Refactor declaration of LSM hooks Message-ID: <20200324160616.GA9173@chromium.org> References: <20200323164415.12943-1-kpsingh@chromium.org> <20200323164415.12943-3-kpsingh@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23-M?r 12:56, Andrii Nakryiko wrote: > 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 :) I like lsm_hook_defs.h better too :) Updated. - KP > > > [...]