Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4239607ybb; Mon, 23 Mar 2020 16:41:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsvmVaSUW0pmZOGCvWVpDqW5z9uU9NBEHJZ4ifyt0A0z5NpF9zLL6JqnUfSIlWYLlGYG4qh X-Received: by 2002:a9d:5cc5:: with SMTP id r5mr18619130oti.43.1585006888231; Mon, 23 Mar 2020 16:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585006888; cv=none; d=google.com; s=arc-20160816; b=YXyOqs42oEcOhVaRp0Fa5aOHgbA4GE06V/pCpH9SWixRlibvzgz/lRLCMxldO+1iKW B1/nWbTDVcjwGnG7PDLWkDdND7bGCynCXe/30uFbI4n5Rp0bvqL5IrmbRZOILkLQ0P+V Kh8u5u+5ZjGGfM9tpTg3OJYRBttuO7kMuShRp4x8M5o9b07LIhtuDG0UnjqIFogrN7Ht hFDFcxMnhk+mnMg3DEwZMUvacgdY9QoX/oOLB49Vg6iwPwV7vKv/YP6PZGhRfLrNTS/K RtgWHsdVtdcTee2yDkTacvyQyEck3V+6jjN6Bic6LSgKYZpiBDcT3ayOOXfLaLPyHh1H uO/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=MJWGaVmo+AsHi/3jj332w3mOjY/Yve8JIABkzYpaYQE=; b=oGA99P9p3oBsUF2VZBp4Rh14eG8UQuhzu0Zx+MJINZTuSoGJll/FvpQ8E5EXbw+KsU rL7qmbmNohVPU+hHEOrRxphmGQEh271oLaGRaNGIPmRoQOAGnexyOrDgThl5CkIdKK2D vA52YujbpEgUzh1tWx7/wwO2lRzP82Zneotm496n1OhXrWfeFTEq3XDTL9QdyvLEb3le o6P4ChBhLKxbvnBii6IcQJzXBYXbvEWAbFaOooQLFq7MZ6wu10gdSlr55seCJMp6IW1U J46WsL8qbD50XTqWIyRiwVJDwSOKezSan0AWCM5tIEzGkpiS/qK0RpOURGYsf0MsPuPL 3m/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=FmLIi+2k; 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 m3si8398963otn.302.2020.03.23.16.41.15; Mon, 23 Mar 2020 16:41:28 -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=@yahoo.com header.s=s2048 header.b=FmLIi+2k; 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 S1727112AbgCWXjo (ORCPT + 99 others); Mon, 23 Mar 2020 19:39:44 -0400 Received: from sonic307-16.consmr.mail.ne1.yahoo.com ([66.163.190.39]:40619 "EHLO sonic307-16.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726955AbgCWXjm (ORCPT ); Mon, 23 Mar 2020 19:39:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1585006781; bh=MJWGaVmo+AsHi/3jj332w3mOjY/Yve8JIABkzYpaYQE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=FmLIi+2kp3ENxhgd8FKh+ifmeTEpdolfFuevHdcgLiV5+B91ZYkwY7W5vAINDd1Nxs9XWVw6u1yLqeqOx4ZgFf3vH07i6pbI+4y6TVEQC0xkt1x99KNG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G ARCCa4N36nsIZzgFDES8bg4jiTHOTLuGV.SeLLFeMFzHhNWOM.LgbuqC.KcWjxkwAaDs0SwZjxEF cuijUMqVuLmb5uwAgC1Zg0rOoIMexfeATenA9XZ1dhkW7zOsLqq_5WS3n8XLl8aU8EDUE.K.1O62 0Vx70DDarWwT5lUqusFp7UXEefM.hb0CYAJeOBpg6PkNzu9Awt4TGr07uCy9Ewgx2shQeo5ScDav _r9yLltpupukIPzaLWaAixCBV5F0UIWjLjBtS.oS5Rhhtw8ZPccmrCIiecUHsz36eHmHVeetBUfC BjmTYjZGImpbgWFbU1nu0TP4qiM3KRNJEZFxTs8KmUNzmMgrJTqgSeX6wxHHZUg1JBbQIIyKArWW _02muk5e2.odlyGhnexRwHraPx9gO_qU_dMEarlQ0LskHD0y1khHxOah3qhXFAV0ZzmcXH8_cLEx MXwCk3QoVmoxDSBfanKTtMYoYENw_eSk6HMoCTQPYax0w1t5mTVhHxouRXzDZ3duuRaedTTLFBr1 QoqhvlTSDH.j2s46pZxvbVbBpQdwu4UKY5Nv.E03G4qswVkhKRS2pMu6VhZ6QReD6tr0rEFIXDgL JX2oMJpt91OZWbMyww82Y288- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Mon, 23 Mar 2020 23:39:41 +0000 Received: by smtp430.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 57ac69c284dcd51f75714b7a846e1efd; Mon, 23 Mar 2020 23:39:39 +0000 (UTC) Subject: Re: [PATCH bpf-next v5 5/7] bpf: lsm: Initialize the BPF LSM hooks To: Kees Cook Cc: KP Singh , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Brendan Jackman , Florent Revest , Alexei Starovoitov , Daniel Borkmann , James Morris , Paul Turner , Jann Horn , Florent Revest , Brendan Jackman , Greg Kroah-Hartman , Casey Schaufler References: <20200323164415.12943-1-kpsingh@chromium.org> <20200323164415.12943-6-kpsingh@chromium.org> <202003231237.F654B379@keescook> <0655d820-4c42-cf9a-23d3-82dc4fdeeceb@schaufler-ca.com> <202003231354.1454ED92EC@keescook> <202003231505.59A11B06E@keescook> From: Casey Schaufler Autocrypt: addr=casey@schaufler-ca.com; keydata= mQINBFzV9HABEAC/mmv3jeJyF7lR7QhILYg1+PeBLIMZv7KCzBSc/4ZZipoWdmr77Lel/RxQ 1PrNx0UaM5r6Hj9lJmJ9eg4s/TUBSP67mTx+tsZ1RhG78/WFf9aBe8MSXxY5cu7IUwo0J/CG vdSqACKyYPV5eoTJmnMxalu8/oVUHyPnKF3eMGgE0mKOFBUMsb2pLS/enE4QyxhcZ26jeeS6 3BaqDl1aTXGowM5BHyn7s9LEU38x/y2ffdqBjd3au2YOlvZ+XUkzoclSVfSR29bomZVVyhMB h1jTmX4Ac9QjpwsxihT8KNGvOM5CeCjQyWcW/g8LfWTzOVF9lzbx6IfEZDDoDem4+ZiPsAXC SWKBKil3npdbgb8MARPes2DpuhVm8yfkJEQQmuLYv8GPiJbwHQVLZGQAPBZSAc7IidD2zbf9 XAw1/SJGe1poxOMfuSBsfKxv9ba2i8hUR+PH7gWwkMQaQ97B1yXYxVEkpG8Y4MfE5Vd3bjJU kvQ/tOBUCw5zwyIRC9+7zr1zYi/3hk+OG8OryZ5kpILBNCo+aePeAJ44znrySarUqS69tuXd a3lMPHUJJpUpIwSKQ5UuYYkWlWwENEWSefpakFAIwY4YIBkzoJ/t+XJHE1HTaJnRk6SWpeDf CreF3+LouP4njyeLEjVIMzaEpwROsw++BX5i5vTXJB+4UApTAQARAQABtChDYXNleSBTY2hh dWZsZXIgPGNhc2V5QHNjaGF1Zmxlci1jYS5jb20+iQJUBBMBCAA+FiEEC+9tH1YyUwIQzUIe OKUVfIxDyBEFAlzV9HACGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQOKUV fIxDyBG6ag/6AiRl8yof47YOEVHlrmewbpnlBTaYNfJ5cZflNRKRX6t4bp1B2YV1whlDTpiL vNOwFkh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ca.com> Date: Mon, 23 Mar 2020 16:39:35 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202003231505.59A11B06E@keescook> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Mailer: WebService/1.1.15518 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_242) Content-Length: 869 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/23/2020 3:12 PM, Kees Cook wrote: > On Mon, Mar 23, 2020 at 02:58:18PM -0700, Casey Schaufler wrote: >> That's not too terrible, I suppose. What would you be thinking for >> the calls that do use call_int_hook()? >> >> rc =3D call_int_hook(something, something_default, goodnesses); >> >> or embedded in the macro: >> >> rc =3D call_int_hook(something, goodnesses); > Oh yes, good point. The hook call already knows the name, so: > > #define call_int_hook(FUNC, ...) ({ \ > int RC =3D FUNC#_default; \ > ... That makes the most sense, I think. It's getting a little heavy on hidden magic, but we do tend to have a pretty good set of eyes watching when a new hook is proposed. I would expect the changes to call_int_hook(= ) and its callers should be made when default is added to LSM_HOOK, not after.