lkml.org 
[lkml]   [2021]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] bpf: Drop disabled LSM hooks from the sleepable set
    On Mon, Jan 25, 2021 at 7:55 AM Mikko Ylinen
    <mikko.ylinen@linux.intel.com> wrote:
    >
    > On Sat, Jan 23, 2021 at 12:50:21AM +0100, KP Singh wrote:
    > > On Fri, Jan 22, 2021 at 11:33 PM KP Singh <kpsingh@kernel.org> wrote:
    > > >
    > > > On Fri, Jan 22, 2021 at 1:32 PM Mikko Ylinen
    > > > <mikko.ylinen@linux.intel.com> wrote:
    > > > >
    > > > > Networking LSM hooks are conditionally enabled and when building the new
    > > > > sleepable BPF LSM hooks with the networking LSM hooks disabled, the
    > > > > following build error occurs:
    > > > >
    > > > > BTFIDS vmlinux
    > > > > FAILED unresolved symbol bpf_lsm_socket_socketpair
    > > > >

    [...]

    >
    > Agree, a way to get the set automatically created makes sense. But the
    > extra parameter to LSM_HOOK macro would be BPF specific, right?
    >

    The information about whether the hook "must not sleep" has been
    mentioned sporadically in comments and

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/lsm_hooks.h#n920
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/lsm_hooks.h#n594

    I think it would be generally useful for the framework to actually provide this
    in the definition in the hook and then ensure (by calling
    might_sleep() for hooks
    that can sleep).

    - KP

    > -- Regards, Mikko

    \
     
     \ /
      Last update: 2021-01-25 18:53    [W:3.085 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site