From patchwork Tue Sep 1 16:18:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alice C. Munduruca" X-Patchwork-Id: 2296121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hZ9yv0jPFz1xyG for ; Wed, 02 Sep 2026 02:18:46 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1x1RBz-0005nY-Ca; Tue, 01 Sep 2026 16:18:35 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1x1RBw-0005n2-Vl for kernel-team@lists.ubuntu.com; Tue, 01 Sep 2026 16:18:33 +0000 Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 5E7093F66D for ; Tue, 1 Sep 2026 16:18:32 +0000 (UTC) Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-7e9dc0f5900so1615813a34.0 for ; Tue, 01 Sep 2026 09:18:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788279511; x=1788884311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=pklLWaoCdKAH9irTAMAhqKuddUvW608ZHUl1LQwya/4=; b=BNKmxrjMHZlz8hyzLis/H7LO48iM/34kdPYZfUj/th3lYDY9yKwU3tKC79JQAnkBeH 7hQlK6RKyrid2OS14KOLDbJnXFrHeIAkHGDenGucs6w0PITMVyydKDIRK/GaHyc78F25 XUhH5P3AyOCCQQM9+ghuesJcCbKiyMHg6OObOZZEoKfnr/foFI3VMjVsWEuRgCwYKePV KFnsO7oj6T4dQbd6VeWOSlK2Gu0YckJ5nw6TISipuqCBXm028F8UH+AZcrkW0lKZe3gx VkLibOw3un7rrs1Qc9bPc5yKG2CuTpVscf4LpEiBDY/OfLfAwWtJqq5M8/l10mctO94A Wi4Q== X-Gm-Message-State: AFuF++mzpQzSX37D1/s1MI7NSLpVz6rTP45iAhzgZQbXu8tQqv7LRTYf VaB4m6iOmny9m+XOP7QBBmyFsSbd0hfrVPDDbowc+x+5VRvdp4bIpSKqFi2P55ruO4u4Sj53q+E Mz0uwc6en8PKb8UkWWJxaSaiD6fvfaao6Pzf9HInvhpJZivDFlIDnt8IXRoIghhWjQ6OI3bQw3k 02hgh0ckn5IUcoaQ== X-Gm-Gg: AR+sD10GuygikklCFTLxOaBLWHObNft2H+id6tPY0s/asyLw7ll/Kir75x7NJ2nWjgE NwZ44TOARE0iE7jLs43HLsFWdPoAAj0aBVHdpIsNX/zAfnNJOuDyaM0LwdDVbMXqObI/hFGYIH5 ZgB0TpFMDMUEM94PtHdzIfWBF/L+6oEHoJzs/coPPivTDfae6kox0Sw2faSLCQfwNGe2mWJuNZ7 7oPHxU6dDXQZh6hBZTuYieggTcHw/4TAGk65FHjVFZYpwsAD5GgRkTwxT8dTU8A0uivYdwVrd7E OUM8MdYuyljlCCbr+0qfiB1EgbV4TrJ8P/s5ISJLXAZuH2zZedncGKtIBN3TQy+W2EX3eBGMQaO Vaw97i9oGNmt0KdjqgbTHrnTRHT0jqK9YtjOvnXLL8Sl476pXed/omRf19vjw77d75pBiU2u+ X-Received: by 2002:a05:6820:4b0c:b0:6b1:4845:9a76 with SMTP id 006d021491bc7-6b3785207efmr5026334eaf.1.1788279510916; Tue, 01 Sep 2026 09:18:30 -0700 (PDT) X-Received: by 2002:a05:6820:4b0c:b0:6b1:4845:9a76 with SMTP id 006d021491bc7-6b3785207efmr5026266eaf.1.1788279510495; Tue, 01 Sep 2026 09:18:30 -0700 (PDT) Received: from localhost (bras-base-qubcpq0974w-grc-38-70-24-127-164.dsl.bell.ca. [70.24.127.164]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-46f3046b2absm97713fac.1.2026.09.01.09.18.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2026 09:18:30 -0700 (PDT) To: kernel-team@lists.ubuntu.com Subject: [SRU][R][PATCH 1/1] UBUNTU: SAUCE: Revert "bpf: Verifier support for sleepable tracepoint programs" Date: Tue, 1 Sep 2026 12:18:27 -0400 Message-ID: <20260901161827.410004-2-alice.munduruca@canonical.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260901161827.410004-1-alice.munduruca@canonical.com> References: <20260901161827.410004-1-alice.munduruca@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Alice C. Munduruca via kernel-team" From: "Alice C. Munduruca" Reply-To: "Alice C. Munduruca" Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2165872 This reverts commit 2946e2f49e86d17c3b2fc8ba57de4b39dd5b58f4. This commit was picked up by upstream stable linux-7.1.y in order to simplify the cherry-pick for commit 5b038319be44 ("bpf: Reject sleepable BPF_LSM_CGROUP programs at load time"), however the other patches in the series, which are required for a non-regressing bpf subsystem, were not also added. As a result, remove this superfluous breaking change and simply retain the changes for rejetcting sleepable BPF_LSM_CGROUP programs. Signed-off-by: Alice C. Munduruca Acked-by: Edoardo Canepa Acked-by: Vinicius Peixoto Acked-by: Andrei Gherzan --- kernel/bpf/syscall.c | 5 ----- kernel/bpf/verifier.c | 13 ++----------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index c531555cc2d9..4f4a61cbd813 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -4311,11 +4311,6 @@ static int bpf_raw_tp_link_attach(struct bpf_prog *prog, if (!btp) return -ENOENT; - if (prog->sleepable && !tracepoint_is_faultable(btp->tp)) { - bpf_put_raw_tracepoint(btp); - return -EINVAL; - } - link = kzalloc_obj(*link, GFP_USER); if (!link) { err = -ENOMEM; diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index d4e38697a704..22ea58b98a8c 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -25205,12 +25205,6 @@ int bpf_check_attach_target(struct bpf_verifier_log *log, btp = bpf_get_raw_tracepoint(tname); if (!btp) return -EINVAL; - if (prog->sleepable && !tracepoint_is_faultable(btp->tp)) { - bpf_log(log, "Sleepable program cannot attach to non-faultable tracepoint %s\n", - tname); - bpf_put_raw_tracepoint(btp); - return -EINVAL; - } fname = kallsyms_lookup((unsigned long)btp->bpf_func, NULL, NULL, NULL, trace_symbol); bpf_put_raw_tracepoint(btp); @@ -25432,7 +25426,6 @@ static bool can_be_sleepable(struct bpf_prog *prog) case BPF_MODIFY_RETURN: case BPF_TRACE_ITER: case BPF_TRACE_FSESSION: - case BPF_TRACE_RAW_TP: return true; default: return false; @@ -25442,9 +25435,7 @@ static bool can_be_sleepable(struct bpf_prog *prog) return prog->expected_attach_type != BPF_LSM_CGROUP; return prog->type == BPF_PROG_TYPE_KPROBE /* only for uprobes */ || - prog->type == BPF_PROG_TYPE_STRUCT_OPS || - prog->type == BPF_PROG_TYPE_RAW_TRACEPOINT || - prog->type == BPF_PROG_TYPE_TRACEPOINT; + prog->type == BPF_PROG_TYPE_STRUCT_OPS; } static int check_attach_btf_id(struct bpf_verifier_env *env) @@ -25466,7 +25457,7 @@ static int check_attach_btf_id(struct bpf_verifier_env *env) } if (prog->sleepable && !can_be_sleepable(prog)) { - verbose(env, "Program of this type cannot be sleepable\n"); + verbose(env, "Only fentry/fexit/fmod_ret, lsm, iter, uprobe, and struct_ops programs can be sleepable\n"); return -EINVAL; }