[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4e8c7d6d-f71b-9b9e-0b8f-5bd188cbf2cc@schaufler-ca.com>
Date: Mon, 23 Mar 2020 16:39:35 -0700
From: Casey Schaufler <casey@...aufler-ca.com>
To: Kees Cook <keescook@...omium.org>
Cc: KP Singh <kpsingh@...omium.org>, linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
Brendan Jackman <jackmanb@...gle.com>,
Florent Revest <revest@...gle.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
James Morris <jmorris@...ei.org>, Paul Turner <pjt@...gle.com>,
Jann Horn <jannh@...gle.com>,
Florent Revest <revest@...omium.org>,
Brendan Jackman <jackmanb@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH bpf-next v5 5/7] bpf: lsm: Initialize the BPF LSM hooks
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 = 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; \
> ...
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.
Powered by blists - more mailing lists