Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3087870rwb; Mon, 15 Aug 2022 17:49:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR73O0qTFPZI7dnEXi9I+H3398Fg/xeeCQV6f9MQMnidRaVo7EqdqhtmHhE9llJHhILEe9bp X-Received: by 2002:a17:906:84ef:b0:730:ba33:512b with SMTP id zp15-20020a17090684ef00b00730ba33512bmr11978775ejb.346.1660610999674; Mon, 15 Aug 2022 17:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610999; cv=none; d=google.com; s=arc-20160816; b=OwgRDo7visbXIrDDnjZMlK04IiAQmMJVV9FD96CnTdDfN7zUX7JndsfOYEXxU9rF27 J190WJHIdxrf6Z4WBGrEFxveG8HR8fMMaHX9W4jdSZ9V+k97hokLTMRAIRMRhiagU5ui zxFg05JklEkZVy3Jjmd7au8hzGjv+Kr92S3YK1gTAmnocmAMx7j10RFe7+ObhVqUbm+P M/1tPAOs0u5IUPA0nBh6tMn+4ShOUVcsghG9diJm10JzzQ7JTF76rAuE7MokiJQNkTo+ UF/UX7Ap3eT7nqtqgOeDh5nV4KR57vjv+USDAD1P2SPqlfkCGja6OUSM3ZFe9tMu/+Id HipQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ifm/KM9Vi9rwfL+O1wes4gxJbIEanhWQjD1O4J4pZ4c=; b=wCrSHldhaNMbUi782u1ycQOC0XFh/00gEyQILnR9o9sxSLWLXAQ6PGxNvQ5sVJ9mfk yjHy1NPbAHU6A8OghddS7y2HRUUG3KkZbV4Csc3RLmWHM/q2Pz83ZNkaO+BcpejKBmcu eUIdaXPJUuu/SdAlkJb1WGjwRzj9bQjlPX7Z0CZxXyFKKBsGUJejP7gk41SqiSfbSEfv xsnelP5v8dCh9a+ESt1gRUo683a1fDnKNypvVO+LUm6bp6JPnDfTXAEJ3xL7ADzu6g6Z CkTx7f51ajbe+3YUNDYkbSs3FGx5pF91O9RGbQcSdjTk2wCsUsA/yRWE/rYOp2BY+RGX a6sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vhDjpzW/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a056402280900b00442c272f4f7si10376353ede.537.2022.08.15.17.49.34; Mon, 15 Aug 2022 17:49:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vhDjpzW/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234642AbiHOXLg (ORCPT + 99 others); Mon, 15 Aug 2022 19:11:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352822AbiHOXI7 (ORCPT ); Mon, 15 Aug 2022 19:08:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9CDC8708C; Mon, 15 Aug 2022 12:59:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 92DBEB80EAD; Mon, 15 Aug 2022 19:59:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D92BBC433D7; Mon, 15 Aug 2022 19:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593589; bh=pA8ISevhUsGe/p5+9L1xkYfUhHfjRk8HP8uS3OlHxrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vhDjpzW/7I5qgbLnHapEpnN/MO1OgVH7qUwQeoexwGg8zIT52puU0iqm36WpxYVO9 +RVYpIztISdBAzL/9oHjCi/42JRDYF0GOUe64kqMWkbiQhJWU5GIaY68499SJ1O7Tg irvb6VI7bwoaWyKCvVeundAHmeu/jp7Mw8AehS68= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "x86@kernel.org" , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrew Morton , "Steven Rostedt (Google)" Subject: [PATCH 5.18 0972/1095] ftrace/x86: Add back ftrace_expected assignment Date: Mon, 15 Aug 2022 20:06:11 +0200 Message-Id: <20220815180509.279790937@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Steven Rostedt (Google) commit ac6c1b2ca77e722a1e5d651f12f437f2f237e658 upstream. When a ftrace_bug happens (where ftrace fails to modify a location) it is helpful to have what was at that location as well as what was expected to be there. But with the conversion to text_poke() the variable that assigns the expected for debugging was dropped. Unfortunately, I noticed this when I needed it. Add it back. Link: https://lkml.kernel.org/r/20220726101851.069d2e70@gandalf.local.home Cc: "x86@kernel.org" Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Andrew Morton Cc: stable@vger.kernel.org Fixes: 768ae4406a5c ("x86/ftrace: Use text_poke()") Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/ftrace.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -93,6 +93,7 @@ static int ftrace_verify_code(unsigned l /* Make sure it is what we expect it to be */ if (memcmp(cur_code, old_code, MCOUNT_INSN_SIZE) != 0) { + ftrace_expected = old_code; WARN_ON(1); return -EINVAL; }