Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4176863ybb; Mon, 23 Mar 2020 15:14:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsW9rd9d2kTOA9kxf0X+9DYDJHBkRz8MbDPgIWi5bPhvxNWFFcevt5Bqn9/xWhcKf2ECXwU X-Received: by 2002:a9d:2963:: with SMTP id d90mr18478123otb.149.1585001679028; Mon, 23 Mar 2020 15:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585001679; cv=none; d=google.com; s=arc-20160816; b=KQaqsID+5DpBzZUuojaNBtVyuLGpLHuc1gV1e/6W8giqNVgA13Root9MgKVY3TJ10Z 4SuPz964raOVOMzMEBJgPR/qM3Vyut8C8RH7gAJ6xR91NMwbLuz/1b4+oGEtcR69lZOI kR1R/R6STcXw/3B2LAQJb25azLyXMb8GKf19owgEnrDNJGEsA1Sw0Y2VKAhNQXgHlzd3 hzRir+obROj8akdt+T7D6htuUYJzzX66NyDndAfFQh9Tur/YWIkB7zS67gxBetBH3KN/ xeRg/EYA0kft4dV6YPH8p9HEjfcD04ege9YFRQkuRLl+3hbLYgTRh9aSs+/dBQqcDEnU 7EXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=92eMcScMHzLsM3YLHA5MQQOWrOz5V0JmQ5WHjN3eFqc=; b=C1tniJO4RE71qq/n1Zf0z9PdB/1QjrTJke3Ed3tS1/8OJu4ktvAz1WIbFgXStrSZwJ N25aJpnHRUUyG14SMVClBSMtELechjZKSTGmP2nsep1p4/6+9bMhVv9NnYuNAHvKny7p 77RQX43DrqyEHR3w+Su4A7LqJlbaQmAdxohOZXX/a2no1R2uVvKUQ2NV+alfH2OxdrKP B+DCenzw4CrxRW8jauXKa1barXlnnrQTebyj4sl91q/XMDMYQ797lqj+afHGLRhMBJdw HgXe7XmQI6LeiJVr/Tw7kyLTl6Oy2+mBC3G17t8GDSAh5dqFd63RYKCdZD9nysevNXKg o1hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="DEv6f/ar"; 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 l18si8099028otk.246.2020.03.23.15.14.25; Mon, 23 Mar 2020 15:14:39 -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="DEv6f/ar"; 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 S1727025AbgCWWNA (ORCPT + 99 others); Mon, 23 Mar 2020 18:13:00 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:33228 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726955AbgCWWNA (ORCPT ); Mon, 23 Mar 2020 18:13:00 -0400 Received: by mail-pg1-f193.google.com with SMTP id d17so7363005pgo.0 for ; Mon, 23 Mar 2020 15:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=92eMcScMHzLsM3YLHA5MQQOWrOz5V0JmQ5WHjN3eFqc=; b=DEv6f/arYuAkMXEExc1Zkk2MvoR8IFP/Pml3yN15/cNv/NtsRD735UCDzVUHOIshF+ VKCD3e4+1VsG4px4lDkaZEq9zVLA9AKGLdqilzHDcK+r2trEpuok365MwyiBLiVR3LoE o8yz5zZ/lcQPyPET2MY6aA7d7rG88ugW7Jypw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=92eMcScMHzLsM3YLHA5MQQOWrOz5V0JmQ5WHjN3eFqc=; b=WNr74AHlKJvdA9F8iA35siTWk3BtRe34Kk3zTx1eAaa30D58J+k2M9fpi0kVsKFp/m c7oD1QPn3mqR929HhAkPrkL+36s5bLkS4JcFDXODLLBmPhs9UG417gs21tIQpvvr4Tnd VPyobTO1u5tGf9qCpYzSS/bM5qPne3nobcEIWz1c28YOGLm/LOLliN6JyJ5YMKUDOKB6 gj5JNvz5d0iBnYzZkSj7L7Rfitn+VbMTkiEdQnU/Ep+QWfhx3NWtXNrblMVXOkF7I42R Xdwe254vSQ2KRQSYnraEBNA8v29szrADEVPXLZSME4kjlyOR/yNrVjHJ7QsbkJeGza2x dCgQ== X-Gm-Message-State: ANhLgQ1rW799XAvo/Nam1kWeG44aYPXrhytXZ0aLPsuo8mGTkT5/pNxO NK5mom7GbbFVeE8OIVxGm34fvA== X-Received: by 2002:a62:fc07:: with SMTP id e7mr27028245pfh.299.1585001579208; Mon, 23 Mar 2020 15:12:59 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n22sm514447pjq.36.2020.03.23.15.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 15:12:58 -0700 (PDT) Date: Mon, 23 Mar 2020 15:12:57 -0700 From: Kees Cook To: Casey Schaufler 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 Subject: Re: [PATCH bpf-next v5 5/7] bpf: lsm: Initialize the BPF LSM hooks Message-ID: <202003231505.59A11B06E@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; \ ... -- Kees Cook