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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 70126C282DD for ; Tue, 7 Jan 2020 21:23:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DEB8206F0 for ; Tue, 7 Jan 2020 21:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729233AbgAGVXN (ORCPT ); Tue, 7 Jan 2020 16:23:13 -0500 Received: from namei.org ([65.99.196.166]:55898 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728855AbgAGVXC (ORCPT ); Tue, 7 Jan 2020 16:23:02 -0500 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id 007LMRpJ014254; Tue, 7 Jan 2020 21:22:27 GMT Date: Wed, 8 Jan 2020 08:22:27 +1100 (AEDT) From: James Morris To: KP Singh cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-security-module@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Kees Cook , Thomas Garnier , Michael Halcrow , Paul Turner , Brendan Gregg , Jann Horn , Matthew Garrett , Christian Brauner , =?ISO-8859-15?Q?Micka=EBl_Sala=FCn?= , Florent Revest , Brendan Jackman , Martin KaFai Lau , Song Liu , Yonghong Song , "Serge E. Hallyn" , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Nicolas Ferre , Stanislav Fomichev , Quentin Monnet , Andrey Ignatov , Joe Stringer Subject: Re: [PATCH bpf-next v1 06/13] bpf: lsm: Init Hooks and create files in securityfs In-Reply-To: <20191220154208.15895-7-kpsingh@chromium.org> Message-ID: References: <20191220154208.15895-1-kpsingh@chromium.org> <20191220154208.15895-7-kpsingh@chromium.org> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Dec 2019, KP Singh wrote: > From: KP Singh > > The LSM creates files in securityfs for each hook registered with the > LSM. > > /sys/kernel/security/bpf/ > > The list of LSM hooks are maintained in an internal header "hooks.h" > Eventually, this list should either be defined collectively in > include/linux/lsm_hooks.h or auto-generated from it. > > * Creation of a file for the hook in the securityfs. > * Allocation of a bpf_lsm_hook data structure which stores > a pointer to the dentry of the newly created file in securityfs. > * Creation of a typedef for the hook so that BTF information > can be generated for the LSM hooks to: > > - Make them "Compile Once, Run Everywhere". > - Pass the right arguments when the attached programs are run. > - Verify the accesses made by the program by using the BTF > information. > > Signed-off-by: KP Singh Reviewed-by: James Morris -- James Morris