Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4332264ybb; Mon, 23 Mar 2020 18:53:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsCMSJstepHNVLYL//jR4gQSVhiaRGHz3oR239Tf4fdbePq1wiaAs7gB95Eo1Gv1Q2Ef/fU X-Received: by 2002:a05:6830:3090:: with SMTP id f16mr19558767ots.211.1585014811431; Mon, 23 Mar 2020 18:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585014811; cv=none; d=google.com; s=arc-20160816; b=l8NzwgyMx/GI0cQ7dpTC6/fbCfNYIoByOWlSHzuI+gNzcWp9VxzK4jtQQx82Z0ZVL3 A4i0ZHGWb6kEPblQItQsoVA7e0XoKnqNUFRpcXCl47iMPxSNLKBVY967s2KibHdDY57u Yni1D76U2c2X3J1DhCG16hNYjJi7V8RYVW6IHi1echwVTzSeqMDKfNkMztwyNVHUM8Bn au02A2b4K6XP0fRtzxhHup8i+tttbbl3U6Z4A96zjCw2KaUxtCNc1q5O8yqMQdUWlrpn /8aDFJ24JQIMxFZxKQWoyRQrCf+cQRifgD9/axTKAka3vzAJhx3KDIhW2K/YBFUCi7cP AySg== 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=GbEsPGbYy5/MMngLexS7oQCXLwm/Hp/VeyWHkCMZX1E=; b=cQovriJ2QzzFAGUUtJ4m27Hp1YHsWLBiuL6f3Cy2ifC1Ah4wlMTFIP4WB/dJI5c+fT SMbN21MtD2kDZuudVux8pZx2OVbhHim2s57gq/WfYXCWiplCH6YdScqzGDVyUmNHDb9Q 6kEnAtwR6DinnToTM4grjIQ3cCdJQjM9/jKpfAYAaCKNKoVIU5gj+VE6R2SayYWZm+Vo KOJM2tnyMKX7DB+0N9Q6jahqN7HHphzlCQl86BU4NA3fUA9ScILQGjZlE9AkEomjqAm7 JI8KIehyKOt2eEio0dX72k4y+Sc344LlRMpJ7b/gVTlPpilkL6EdMwAO4CQQE4BKZpft H8hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=E+Ul25EE; 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 e24si8441267oti.10.2020.03.23.18.53.18; Mon, 23 Mar 2020 18:53:31 -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=E+Ul25EE; 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 S1727230AbgCXBw1 (ORCPT + 99 others); Mon, 23 Mar 2020 21:52:27 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40504 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727110AbgCXBw1 (ORCPT ); Mon, 23 Mar 2020 21:52:27 -0400 Received: by mail-wr1-f68.google.com with SMTP id f3so19558786wrw.7 for ; Mon, 23 Mar 2020 18:52:26 -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=GbEsPGbYy5/MMngLexS7oQCXLwm/Hp/VeyWHkCMZX1E=; b=E+Ul25EE4P4xI9/A6uidBTsx+WzZyMu7GDfyCMr4tUb5S+8Iq5kNIXaMxobkwzSbDC lB6rZfmT0/arSbWGjm6XgK9/ESRu36tu9I72PJkclggd81WizLjHob1+MAwovGjQPyw8 8EEL+ElBFzl876TjbWP0p10nvBTmOqS60v350= 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=GbEsPGbYy5/MMngLexS7oQCXLwm/Hp/VeyWHkCMZX1E=; b=V7I+5Pf8EHOPvDXPfXp/FvuvbcwhXwJFmvE+k1eMwdsBu6ivQFWtxaeQQWa6m03o2D w0s9+J/i30qmvPnPAoS98RIgpqEnHUO0CkxAfKofTXGwo72LC/2ZrI28g0Ma2AOr3YaI xMxyv2uooeiSIwFiI83BFyD10lYNHpOnfpdTJbPwkjMY6UhCH4RwKx6geQxYK5afu63x 4eHUWlPVRhCuxfSm3ucaZeUs/WuvI0vLfH7RUod29+HUG60bXjPvT7e8hdWePGWjEA8c IhpehKHkoXrpofXLbuMaZHom20eNXMzUOYu+4Avg9kj8Deti5HAVJ5v+JNGtBWplGXZP rgew== X-Gm-Message-State: ANhLgQ298egb4Xr1bEDlG/pvywuaR/kDVdTtoy0PCywzSYHi3ge8GfS1 zNVcTVmyXraWNoiW7NjqYrErfA== X-Received: by 2002:adf:f0c5:: with SMTP id x5mr6132238wro.415.1585014745323; Mon, 23 Mar 2020 18:52:25 -0700 (PDT) Received: from chromium.org (77-56-209-237.dclient.hispeed.ch. [77.56.209.237]) by smtp.gmail.com with ESMTPSA id k126sm2116248wme.4.2020.03.23.18.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 18:52:24 -0700 (PDT) From: KP Singh X-Google-Original-From: KP Singh Date: Tue, 24 Mar 2020 02:52:21 +0100 To: Casey Schaufler Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, 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 5/7] bpf: lsm: Initialize the BPF LSM hooks Message-ID: <20200324015217.GA28487@chromium.org> References: <20200323164415.12943-1-kpsingh@chromium.org> <20200323164415.12943-6-kpsingh@chromium.org> <6d45de0d-c59d-4ca7-fcc5-3965a48b5997@schaufler-ca.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6d45de0d-c59d-4ca7-fcc5-3965a48b5997@schaufler-ca.com> 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 18:13, Casey Schaufler wrote: > On 3/23/2020 9:44 AM, KP Singh wrote: > > From: KP Singh > > > > The bpf_lsm_ nops are initialized into the LSM framework like any other > > LSM. Some LSM hooks do not have 0 as their default return value. The > > __weak symbol for these hooks is overridden by a corresponding > > definition in security/bpf/hooks.c > > > > + return 0; [...] > > +} > > + > > +DEFINE_LSM(bpf) = { > > + .name = "bpf", > > + .init = bpf_lsm_init, > > Have you given up on the "BPF must be last" requirement? Yes, we dropped it for as the BPF programs require CAP_SYS_ADMIN anwyays so the position ~shouldn't~ matter. (based on some of the discussions we had on the BPF_MODIFY_RETURN patches). However, This can be added later (in a separate patch) if really deemed necessary. - KP > > > +};