Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp26956ybl; Tue, 7 Jan 2020 13:24:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwWczoQpFQu9AQLyexpRM/GJ+L4pupmJ5sg13/xT5yQROcOgxxNxL2tqRDZHRvU/K28DhIe X-Received: by 2002:a9d:6d10:: with SMTP id o16mr1819598otp.28.1578432253651; Tue, 07 Jan 2020 13:24:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578432253; cv=none; d=google.com; s=arc-20160816; b=SKYpFgNOmiVRwmtOTAk3hPSPuyCh0WpWG/XrQ74dwn4QdFDmMNx0jVCAajm0xmoBrW phgWmGzD0QSiN/6fap/Qfc8vK+xV+sg6BEqIhjEVG8KJcNBYBCfL3L9TRFmktYT5/Tj1 dysJxuqCylD4kd7+BPI6IU9AaY4NhGBXVPfi1HkNGQHWqszuhyu1aK/HsyvNlVyxkuMv WjPrPwOh601YJpN+SFrNXdiDuO231G1YMIxDjfLh3+ptNhgAbWAN+oV23K3X06Bwqv8c zDo/dR/cinR7GFcHGJEjZ+E+016wA4BtxSbgL9HkiRAHmNVnc8c59C3mbBKOnsBQFWdo mP+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=7DVC0c+p3Uy7TazgBDfJeHnSWL3U44B0whtUmlTGl0A=; b=Hp68f/AymNdSv94EarQxoyRR580S/tsRYdnTEwnj7g1SsfPHWC/xn2hVglsW0UWx4x TgAvMvnTupExxlEJbNw1UNgLynFpTAd76Q0P5h8cjpYvTmFmDAPsDksKRiYWuhxmLVcU oj2/yG/bMmySNoP4biV9eOzTtVkExz6nS/B78Rtf9mmfCfbUQeT4WhRE3JqrXRpsMoTB uEU07JTNMlvzulgdVJMWO4e3SF/O0MpMSrByMDrGfH2xiMJeSnNMwcbf62t8FOdj4uPH M74zVAwzbOYbw07IrS8dcWEXdwVoI0HxqXuVktliaeR9m7rqW/8LgWrdNMqGexsQtjgB /u9A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z65si683338oia.33.2020.01.07.13.24.01; Tue, 07 Jan 2020 13:24:13 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729205AbgAGVXM (ORCPT + 99 others); Tue, 7 Jan 2020 16:23:12 -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