Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp778672pxp; Fri, 11 Mar 2022 14:55:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGhwRc9w/3blQQBoXaimvsWHmHXL+PfjW8Qh4SOk6jrJHVTV4XeUp+rzwSF4Bhu+HkHS4Z X-Received: by 2002:a17:90a:dd45:b0:1bc:9466:9b64 with SMTP id u5-20020a17090add4500b001bc94669b64mr24377273pjv.23.1647039323837; Fri, 11 Mar 2022 14:55:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647039323; cv=none; d=google.com; s=arc-20160816; b=Pw0BM4VZrUcSwQ1RxgvFkDFL07YVz5/65y1qbLg6kANso/1uuORCPaViT0YMPuvm70 aRFWY7N7KtMYbQamTTHUWwGZD64sWlE/eVER42RK8wJyAawSNH0aefDM2dOs2GoZ15TU CVwhN7LajqFjF4+YfCOYfEl5eOTcpCmnrwI3MDr5yOQmMV2490sVUeAJpbNwB+pg2yts /NbLbjBeSngxQkJujExvj783BZP3OWOm8KVlHeBsKWaxj4o9JLi1sdO3c9891rh7D54K sJYaaGiGfUnfgmGTqfANyhi3JUSBRQUPTCPRRgeItDpwXACBkdz1qC11Gim3Bhe9IP1A edxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=hegKktPR+oSJlZ7eMJINSbSES7bQHZfFFKSD96G5/LA=; b=y5GMTGsyURRAjNo8LQsMhmOI/vWxozrdyd9LYZi5mgXblpe2HLjDSZpwMna4ULihQ2 6OHcpz8e+e5fKj0cEFdLFLK+1pJ6VtPGsHPbXVU7DANBUWYporwA7EjVGq+C2sGais5y 5W+So6IpNu92eKTXdff8wUmTHs1nT9swy6G+yI3aNDRB2kIj9XJM/BgEjpJPOqtRmSa4 pGlAkMDvdJf1kyr+mXrkJ+i0f5vF7VtilMKuCFOlvbPzrHtInDNyxXMpMejJJ1dW6BtI D4o01NHc6JsNLTAKCtnc504a08KZ26mNDQjdWVFWkazkwNPV86QX95FwxBWSZP06knhT I8OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MzcljQCi; dkim=neutral (no key) header.i=@linutronix.de header.b="qy/1hBkv"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m11-20020a170902db0b00b0015328ce8917si5214469plx.106.2022.03.11.14.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:55:23 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MzcljQCi; dkim=neutral (no key) header.i=@linutronix.de header.b="qy/1hBkv"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 82879362AAB; Fri, 11 Mar 2022 13:53:04 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241933AbiCKOmj (ORCPT + 99 others); Fri, 11 Mar 2022 09:42:39 -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: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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/c841668784cc609e7ae103d91c3e03bf8939418d 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=y 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-ass.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); mutex_lock(&ftrace_lock); + + ip = ftrace_location(ip); + if (!ip) + goto out_unlock; + entry = find_direct_entry(&ip, &rec); if (!entry) goto out_unlock;