From nobody Tue Jun 23 03:13:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F013C433F5 for ; Fri, 11 Mar 2022 14:41:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349796AbiCKOml (ORCPT ); Fri, 11 Mar 2022 09:42:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344430AbiCKOm2 (ORCPT ); Fri, 11 Mar 2022 09:42:28 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF9261CE986; Fri, 11 Mar 2022 06:40:57 -0800 (PST) Date: Fri, 11 Mar 2022 14:40:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647009656; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hegKktPR+oSJlZ7eMJINSbSES7bQHZfFFKSD96G5/LA=; b=MzcljQCinP7twuiPsPW9gYtb+h6/YxFv1Rge2rl0hOeXY/H3/vyMTuhaoEt/NK+3JIm8fk mwlTMfvvk8OeYE3AKkmRxLYop/1DpOS/M3GeCRyV5Z6Z+c4JIgzB21EFqhtlimuh2IMfHD 1FN6F2yK6mr6vfyzEFsxDPdxnpSvOPKj+Z+EhV7MOqZhhGUuHXMhHhCKtOr/HqR8TgtiIn TZSfAIlGRVFt5KywHHLNZxxl8uABvW9LwJTqB2nMS1Xj0Urbt5BXbtViBS+VuAJnMJQCwF ZRRrXdszCIRUSlnZsEpGrT43GMydsanBzfRQumYtAW43viWxNAEfJvLScgUjiQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647009656; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hegKktPR+oSJlZ7eMJINSbSES7bQHZfFFKSD96G5/LA=; b=qy/1hBkvMQUckH55AU62qHWpu0LfLVlvuJxuKcj7tKjd7eZhE5L9iIuEJFtykiVVPNRY5C jf3DVp+lpLl3GxBw== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/core] x86,ftrace: Fix modify_ftrace_direct() Cc: Alexei Starovoitov , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <164700965551.16921.1526159512411364871.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/core branch of tip: Commit-ID: c841668784cc609e7ae103d91c3e03bf8939418d Gitweb: https://git.kernel.org/tip/c841668784cc609e7ae103d91c3e03bf8= 939418d Author: Peter Zijlstra AuthorDate: Fri, 11 Mar 2022 10:40:40 +01:00 Committer: Peter Zijlstra CommitterDate: Fri, 11 Mar 2022 13:05:08 +01:00 x86,ftrace: Fix modify_ftrace_direct() Alexei reported that BPF direct trampolines are no longer working with IBT=3Dy builds. Make modify_ftrace_direct() consistent vs {,un}register_ftrace_direct(), such that they all agree on where the __fentry__ site lives. Fixes: ee1a8cf8dd0f ("x86/ibt,ftrace: Search for __fentry__ location") Reported-by: Alexei Starovoitov Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YioBZmicMj7aAlLf@hirez.programming.kicks-as= s.net --- kernel/trace/ftrace.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index ae0d9f6..8e0509e 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -5381,6 +5381,11 @@ int modify_ftrace_direct(unsigned long ip, mutex_lock(&direct_mutex); =20 mutex_lock(&ftrace_lock); + + ip =3D ftrace_location(ip); + if (!ip) + goto out_unlock; + entry =3D find_direct_entry(&ip, &rec); if (!entry) goto out_unlock;