From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4293C4B513D for ; Thu, 3 Sep 2026 14:14:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788444892; cv=none; b=uS0AYYgepme2GWOExvZESqEk0mrNJt8JDJtED4pT6XC6vXxps5Qd5gIMBgBogoVQ0QcXJAhMg+EZYa+5jj5X2cUcNH+koWb+R0tcpvPp6dQ6kTrkniVfW+lUL+bfbEHHl/t4MgQ6OWUfCUk1QoqOsSvC+ils/IL2k01zLhyyzj0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788444892; c=relaxed/simple; bh=Dp9roZoGfrtFYyqBx/fuMH7K84NsYIGqejisV5CXxpI=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=P83VtGA8wFI5paLq1oXyAiRZdX7t3usrfawViVC0u67+CTsPalQWK51p+qe2CcfLAmAEQX8BICHN8g2fVkneZjtpiFi3L1t+3deUGFIg6cVwi+82wt5uYVRUiOYpNg7kJ1/ey6567/DNgiO3yMGhHIWC7HMPAH6M45mAkCo7uSU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=St5bV2dZ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="St5bV2dZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3460F1F00ADB; Thu, 3 Sep 2026 14:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788444869; bh=L5h1IJJ1OvtaiHfLm3dYvLT3jm17VnRSwvUgHXjDDCQ=; h=Subject:To:Cc:From:Date; b=St5bV2dZPuD3x4SPuwC/xxtkF57mXoJ9lYxQwWmapAl4KA9tHF3q9/+82YFlqnl4p CUSvmgMKZDx5EYkCsJA3eIKysgM56C2qw7M2lvP5BMPb9wuaUMXbHOwSvMC5q/7g9o qlv+ShysZmLmkiSuWnRZKwcQLSNRRvtsG4JwSrxA= Subject: FAILED: patch "[PATCH] bpf: Disable preemption in bpf_get_stackid" failed to apply to 6.12-stable tree To: jolsa@kernel.org,andrii@kernel.org,chen.dylane@linux.dev Cc: From: Date: Thu, 03 Sep 2026 15:51:50 +0200 Message-ID: <2026090349-donor-crunching-700c@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x 15f1bd8574662f1b7b26aaa2e23ebf4066f0117d # git commit -s git send-email --to '' --in-reply-to '2026090349-donor-crunching-700c@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 15f1bd8574662f1b7b26aaa2e23ebf4066f0117d Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Mon, 3 Aug 2026 23:01:42 +0200 Subject: [PATCH] bpf: Disable preemption in bpf_get_stackid The get_perf_callchain call needs disabled preemption plus we need it disabled as long as we access its returned trace entries buffer. Note the bpf_get_stackid_pe function is executed already with preemption disabled. Fixes: d5a3b1f69186 ("bpf: introduce BPF_MAP_TYPE_STACK_TRACE") Reported-by: Tao Chen Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Cc: stable@vger.kernel.org Link: https://lore.kernel.org/bpf/20260803210149.296496-6-jolsa@kernel.org Closes: https://lore.kernel.org/bpf/20260206090653.1336687-2-chen.dylane@linux.dev/ diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c index 3ee0034daf52..5b18d728f4b8 100644 --- a/kernel/bpf/stackmap.c +++ b/kernel/bpf/stackmap.c @@ -632,20 +632,22 @@ BPF_CALL_3(bpf_get_stackid, struct pt_regs *, regs, struct bpf_map *, map, return -EINVAL; max_depth = stack_map_calculate_max_depth(map->value_size, elem_size, flags); - trace = get_perf_callchain(regs, kernel, user, max_depth, - false, false, 0); - if (unlikely(!trace)) - /* couldn't fetch the stack trace */ - return -EFAULT; + scoped_guard(preempt) { + trace = get_perf_callchain(regs, kernel, user, max_depth, + false, false, 0); + if (unlikely(!trace)) + /* couldn't fetch the stack trace */ + return -EFAULT; - err = stackid_fastpath(&stackid, map, trace, flags); - if (err != -ENOENT) - return err; + err = stackid_fastpath(&stackid, map, trace, flags); + if (err != -ENOENT) + return err; - new_bucket = stackid_new_bucket(&stackid, map); - if (!new_bucket) - return -ENOMEM; + new_bucket = stackid_new_bucket(&stackid, map); + if (!new_bucket) + return -ENOMEM; + } return stackid_install(&stackid, map, new_bucket, flags); }