Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1863009rwb; Fri, 19 Aug 2022 10:37:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR4A9stGUbADeRE1ktRrgLlFmuNyUFXIRu0jsMzfzQvGkNT0uUy6J4rBRWR55NIL5yZSk0FR X-Received: by 2002:a05:6a02:205:b0:41b:96dc:bb2a with SMTP id bh5-20020a056a02020500b0041b96dcbb2amr7236760pgb.116.1660930676060; Fri, 19 Aug 2022 10:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930676; cv=none; d=google.com; s=arc-20160816; b=PU9ktMB6inMWrPdbUtiZ8uJwGvLtzAhTI8rxQsscE2EN3Guw0nGKAWl43P4LruJ1KS 3s1zho5/cb/fhM04SgC0q+QPeSAAOBPcOl+ZQcE9jwqkFkbC8anj+/aIGkbatAHXJ4nT uk3leiJmM60FhoaSUP6X8IugRSuWVHbodKU1pl5C3wStmtIbkT5IFsPyVWbALwaYBlPD L2tQIG/pAc0NBE9REm4irLN0tY7jTqdxScJ8DTN8W9HJ3+oFEZvW2hNlsos9H0kQbtZG 1N3iGXVJuTNm8g/2exiC4hqV0hJA6NRFseDxtyt/Ybp05nic6UKhpo31B7z1/CxA9d3c +RbQ== 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=zhP5CGcDi/RbJEAJr4Z8vatBXLXWDKLmaGIlU6M1o5LBVjqzI5t+SJr++5UeE9N9AS yf2sY9BZTSYnlMpZAFM1IHD4y6fgYcNpIK+smpTbEfkPq8YE04pQDjFLy0wi/MAKN5cn vK0eOFRDORYRvXtE6CzwWh6ae9PQ74lENKPch8RWK5Ps2DqS31J0IZSbnHJ6lRVvUiJD gc7UJdZqmqBFDBe3hJdiqeS+b/W/ydG67oai5cgf3oVYKtY8KCDh9czhoFbVHePRRwLP VaHo5lON7fujkzRJAG8HMGZ4D22MoNgMyHSgvQmPv95ocSwQ9KsCz8qok+akolPPmuCq sypQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IXT0Le89; 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 e17-20020a170902d39100b0016e3d42897fsi801845pld.277.2022.08.19.10.37.44; Fri, 19 Aug 2022 10:37:56 -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=IXT0Le89; 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 S1354082AbiHSQps (ORCPT + 99 others); Fri, 19 Aug 2022 12:45:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353702AbiHSQnI (ORCPT ); Fri, 19 Aug 2022 12:43:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1A0D111C1F; Fri, 19 Aug 2022 09:11:04 -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 dfw.source.kernel.org (Postfix) with ESMTPS id AA94B617A5; Fri, 19 Aug 2022 16:09:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A1E4C433D6; Fri, 19 Aug 2022 16:09:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925387; bh=pA8ISevhUsGe/p5+9L1xkYfUhHfjRk8HP8uS3OlHxrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IXT0Le89m5TMyOI2g6MZ/cTgLXhkM2aH1WsXX2LHo8TV2np+I00uEaKQ3YzmcsSN3 AWGga7MuSLubxkZ2UTDMibFXgOpx1B0u5PT9qLtDaNsxRP6EBkUUNNZ9V/Pf3tagyy uxo+rSIy1YB+xlKrlhJZeyTV0SBGJeVeHT7x21xQ= 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.10 446/545] ftrace/x86: Add back ftrace_expected assignment Date: Fri, 19 Aug 2022 17:43:36 +0200 Message-Id: <20220819153849.395764010@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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; }