Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4332994ybb; Mon, 23 Mar 2020 18:54:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvbBfGhhUnkGYCeFwXTvE/sEa2EEu2PwfSLQILch7W44CMm3V7mDmSTqGBnwqsSqhzHy8Fz X-Received: by 2002:aca:f0d7:: with SMTP id o206mr1688715oih.41.1585014873718; Mon, 23 Mar 2020 18:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585014873; cv=none; d=google.com; s=arc-20160816; b=QyGn8LOqnTsyA9yFwE+N/n5NuUz5fOOzWFY58mV3BjP36K03oLZ/V4fNU5Tm5aKxQS cXI+hb+bGBoCRgYlgz+zFRrmjLiqpMU0w8m0r5uIob4m/IwS2+blIfCsx+O4IR42FQb9 O7X0l8KjWMAekI/ILmjh52ziIPnIjLCs9LX6orHHvYMPZBf9Aez7Lgnp9pUrZ1cdwZ4Y 7VXiVF/LReCo5mbdr3K36vzf6QvwzCJkgMCI8M8kpAyXgVHtop7Yy4YUEKvzLpnHSSbS 3DscoHpyDAlkYr8wKnHD9o+MwDwUmkxBv7X66yOHnZ0+2DiU+f8HXPsZMPqHso0s7jzh c6+g== 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=JYmZbOGIiVsldO4I5du4t71vc9EkrrIvswa6uMRtHCY=; b=nAHu6TtuU3TuuPpmoEW0ZgG3BSGz3UJSKLvn1wYiMbqHZhZB0Tx6lnAvDxU5TZajvH EfW8b1dOa368HKTQcmpBAwog9j0puP3CSL4e9hSwSDCMg2tlns+CZ9R0wa92tt4AvAyC m4CxFO2HH6eqUIdwpn1ccDInU7NHOk41VKbjqyXMyFnvU1JBcp0DF2nwuodAuezNstMk 2XheUDdd0FU1wg5hIqoowHJqiUsdJNFoXPiz4VKJPFMYgqSTeWCzmIGSq2Ks0UrkSywY /z/z51YKu3+27EKamLQydwMbDzonrMT9UY6Mv2FeiPFgxIU27KbgJ11tn0iGZraJNsf5 gYMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=COC8ebrj; 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 16si2877508oiq.222.2020.03.23.18.54.20; Mon, 23 Mar 2020 18:54:33 -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=COC8ebrj; 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 S1727213AbgCXBxL (ORCPT + 99 others); Mon, 23 Mar 2020 21:53:11 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36723 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727102AbgCXBxL (ORCPT ); Mon, 23 Mar 2020 21:53:11 -0400 Received: by mail-wr1-f68.google.com with SMTP id 31so13549471wrs.3 for ; Mon, 23 Mar 2020 18:53:09 -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=JYmZbOGIiVsldO4I5du4t71vc9EkrrIvswa6uMRtHCY=; b=COC8ebrj/l5ZJcyLCdJUYHjZrxwLjZwDMfjtqsfpeePDvqsTbYI0BfRB8HZ/RX2v5/ C+DAJ/Wd796qIPgDSXvDW1Ry1PdW8DIiOh1oEjx4l2f/EG+0mP1r0hIcao4/inGTejUL mvAtmweJ3ymCw6plmIyZppvwYr/DHw/QRBoVI= 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=JYmZbOGIiVsldO4I5du4t71vc9EkrrIvswa6uMRtHCY=; b=dEtU7+HpEA+n8d/O6B/rbsE6LxfKSYSJUa6jRCcaCfyyaqruWtGpxkqsU7kQjzGn3w MN58Gv+akPimaF1o5WJPAoCrylX27m0BmcCa3tNTZp2d6TUiCd3U8jGhRZ2OYEPhaPba 5ueWshDxnWAUPiSucs/2GFwHqrJR+19NdOVsQ0MYAhxM+87KiBOtq9PilU9ekx0AYG0s rcVxKqW9wv46nRpGXEFlB0fQWgTZGlboPAG7i9YrO1g17J5vuZ2X/xHh4mMmqbsf2VC+ SYYaRBrznYKy5rAbJtUfRxRqy35bE4aNOT07oZh+PbxO5XouTJnFKS3StdS5/syrQPMU 2few== X-Gm-Message-State: ANhLgQ1P3sQ9cuu+4Kv7kkARRxZU5V5As5CjwpUdSrqiTuF+hDpvi+I4 rK8W5f87lNY15oEShRIZCOBDOw== X-Received: by 2002:adf:b307:: with SMTP id j7mr34750161wrd.128.1585014788959; Mon, 23 Mar 2020 18:53:08 -0700 (PDT) Received: from chromium.org (77-56-209-237.dclient.hispeed.ch. [77.56.209.237]) by smtp.gmail.com with ESMTPSA id f9sm27097170wro.47.2020.03.23.18.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 18:53:08 -0700 (PDT) From: KP Singh X-Google-Original-From: KP Singh Date: Tue, 24 Mar 2020 02:53:06 +0100 To: Kees Cook Cc: Casey Schaufler , 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 Subject: Re: [PATCH bpf-next v5 5/7] bpf: lsm: Initialize the BPF LSM hooks Message-ID: <20200324015306.GB28487@chromium.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202003231505.59A11B06E@keescook> 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 15:12, 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 = call_int_hook(something, something_default, goodnesses); > > > > or embedded in the macro: > > > > rc = call_int_hook(something, goodnesses); > > Oh yes, good point. The hook call already knows the name, so: > > #define call_int_hook(FUNC, ...) ({ \ > int RC = FUNC#_default; \ Excellent ideas, I will spin up the next revision with these changes. - KP > ... > > > -- > Kees Cook > >