Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3218752pxb; Mon, 25 Jan 2021 09:53:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzr4tFgLSaSP/i8ucFFuuTab9gsZOm/a0EGPIHRX2AhIC0vI8m1UwTEoAVDs9MIPwxyuqoc X-Received: by 2002:a17:907:6e6:: with SMTP id yh6mr1089587ejb.466.1611597185057; Mon, 25 Jan 2021 09:53:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611597185; cv=none; d=google.com; s=arc-20160816; b=bsr/0TABfCOkfQZWDBUUrPkEMNDAJtIVuZLMm1p174AttFWH2eyA7Ly46ru46IxcAi 5v6+b6cn2LVM0bpAnMp3t+5Gjt2FUNKz9HfeX+LYLRon7m+0PP7us0m3gYyj4QFtYALu svqt7BvGvrok0TsRxGHXQ/XDvRF77ABKakrAOCA3bmAVIE5yuWFV/dL16hpPNmrXoaIo x5kupKgTZLqNYTfsZ0gtCvOEeRkNpXKaL/7s89WBi+OP3J4fuhgTQpAKQrn03uGGDC/i z009G6CB0jo+Ap91zf3XHYz/B9KgBvU/Q+aehVSTj+3Tin8qWIKI9stc4OkdXuqlXelK 4azQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rUNaflfq6kn0xGxR4VBXsofCpEo8KFc/VMwnrk9U3ZU=; b=TXJY+WuRfQU9FOx6wND9oZ/BhE+yCKtbwDPzhvQFSlgVsG+c/SPPdD4JaIayg/X31k ggMGNMRyxRXhcDSJc4ggl1UfuqkOod8NoEeJwbxtqKTcKUliLwm8iSOh2NM9l10zF3VP zplm7XZmZZZkzswfRBQHrtsc6mQPsAfNiK89K6apli01DvVCuiq1JWwGLd4xKRJOZUIp xVQEpAXkwb7hJV14JSsqSOliTO3Lx9jd9e75CQwO3hmlpeMKHRKL1TQMPJssbvnc7D1e yLssUVOHVwOcuDLcm9/qk2YqfcBapuOkktB8HVGAEocVeZJQPhnAFoNEKwCDJl9ak8vY hX7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NtztpnmE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si7411610edr.140.2021.01.25.09.52.39; Mon, 25 Jan 2021 09:53:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NtztpnmE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731224AbhAYRu6 (ORCPT + 99 others); Mon, 25 Jan 2021 12:50:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:39016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731169AbhAYRuU (ORCPT ); Mon, 25 Jan 2021 12:50:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 72DC922E03 for ; Mon, 25 Jan 2021 17:49:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611596979; bh=zuyRHftsqVWCQjq18XklCtmYkyBWLlstKHGMnVWyIhU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=NtztpnmERvAG+Cu5ZQgPtvxJnbhIc0D5b2rZxAfyC7FjfqSf9U7aW+mGY/epm3Mx2 9HgkT+7I7QMHsq01AmYpqYRUnfNRwPAbF7neKs67HnHmdC0rbr5bxTf/+rvujufQE3 AbZAHOViddhFAZNq9mlwTOapAnzvJeyDc1v1GlgsDeOmFpTlrDFRMQbJA46DXiDKGX W9Y1c8raPjWgA+cVc8qsqeOHlUf1+BhH7iB276EpqCGkUcknlPOR+jeDMwtgsTdy8S i3yXlVRXDyXYnRz4PkPPlwVTgs/31UxDbWc5lDoGg0Y9+EGvWUuvT7hp5BzSDlA4hJ LTwUDemWDExWQ== Received: by mail-lj1-f181.google.com with SMTP id s18so3228133ljg.7 for ; Mon, 25 Jan 2021 09:49:39 -0800 (PST) X-Gm-Message-State: AOAM5320Z09dT10Jneo/2EQLqqok0KO0mLIUAQaEuxg9xXGxXlC83Cy1 BvGVJyAyrjF6OYPdS+Rl1xTnlHCVB/bhoAfEK0bsiA== X-Received: by 2002:a2e:2c11:: with SMTP id s17mr693442ljs.468.1611596977707; Mon, 25 Jan 2021 09:49:37 -0800 (PST) MIME-Version: 1.0 References: <20210122123003.46125-1-mikko.ylinen@linux.intel.com> In-Reply-To: From: KP Singh Date: Mon, 25 Jan 2021 18:49:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] bpf: Drop disabled LSM hooks from the sleepable set To: Mikko Ylinen Cc: bpf , open list , KP Singh , Daniel Borkmann Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2021 at 7:55 AM Mikko Ylinen 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 wrote: > > > > > > On Fri, Jan 22, 2021 at 1:32 PM Mikko Ylinen > > > 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