Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp598277pxb; Tue, 5 Apr 2022 15:27:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUBj8/HYZpi0i1IGn/kns1dA7FcqT77/Awp4d7vLNe9qdgLXx0M8FkIi200JqJwxf6sriF X-Received: by 2002:a65:4144:0:b0:374:315a:7dff with SMTP id x4-20020a654144000000b00374315a7dffmr4597580pgp.506.1649197631305; Tue, 05 Apr 2022 15:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649197631; cv=none; d=google.com; s=arc-20160816; b=zkCzp3a/WtHcT/6RZVewK82LC0eX8T7G1Iy4emih/P3i3T7stWEx2xMZelgspc7krc dBkJ5HQHDlmglA/nQa0tzRc5MJUoTzo1fl/ex1dwtiYk6KAMyN7rYAtdwreTxTOTBm3r xzXv6cUKSxI6dS5pdQ2Zzo9Q8hpl71U3pUvOcGloTONl8he4rvqNhivn5W/k3er2wBBj qzt/DKk3Zwmc4SvFkJDFjah8CW3wo996IsSuGCEH8D+IGlNxRnqFr0aT8kLd2mXZp0iz RH+/s+e0WjWps126HNUTbH1tVKGd/ZpgMpZo3mA76SPTe8CEnfTLkFirwhIhk5mNLT7u DNug== 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=BWmuqfK8IAXxIlYg7dIQTXsXZpPKIzVl9+kSjTuwQyE=; b=CBWGspWs4Jv36Igv+gItxtEQYIImsjpEYSNt9LTB/rNLXo1U+j4r9iiyNCpu2QvMTC FbcWg3F1RxnCfuK36TesD9CxXzWb2uakyzmt8juYhZsyOIt3tpfy4k65PbeHGqhun01C tHDEBsdSVMlhI/cnHMoEln4zVTnK5IYw+bkA/212GSjrJWz+YvBDOfjwgPgFUsj+w6BI h/Z9ZW6w0WbjMXlyq9+iC1ieh20iFRYdY3rx2K9yF60Ygjk3/PIpTbIfuNMKGSI2Gt9V Z5KgUxkIBljnU8gcz+8TeT2Ly31C9e6B+q4kwOq/GDUjZqjoN+wQ/mFIA42b7gydDGlr MqeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CsaJw4ld; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h5-20020a056a00170500b004fa3a8dff76si14256515pfc.45.2022.04.05.15.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 15:27:11 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=CsaJw4ld; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DD000A1449; Tue, 5 Apr 2022 15:09:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389306AbiDEPVO (ORCPT + 99 others); Tue, 5 Apr 2022 11:21:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347056AbiDEJpz (ORCPT ); Tue, 5 Apr 2022 05:45:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E12644E394; Tue, 5 Apr 2022 02:32:17 -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 BE98561368; Tue, 5 Apr 2022 09:32:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5707C385A0; Tue, 5 Apr 2022 09:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151137; bh=7PbildU4fVy2AP3yvxFY7nRP8gtRqmn3F61F8jyqIRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CsaJw4ldPZuWRQi4QNBoaCf3lcEbcIEuseNaNhkhEkiyfn4T35cJr/KSgULkkn7AB 3dNTI2bFKPTsK6vKlt8tv0S1zZhqsuWtU1UDtSRBcsd7GRs+LyLgqRKeEqr/JhW+NT 2LGFV4HUqFe6bP74Pc/V+aANyfaGIMX+Htm+KbUw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Nick Desaulniers , "Steven Rostedt (Google)" , Linus Walleij , Sasha Levin Subject: [PATCH 5.15 307/913] ARM: ftrace: ensure that ADR takes the Thumb bit into account Date: Tue, 5 Apr 2022 09:22:49 +0200 Message-Id: <20220405070349.058006700@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 From: Ard Biesheuvel [ Upstream commit dd88b03ff0c84f4bcbe1419b93a4bed429fed3be ] Using ADR to take the address of 'ftrace_stub' via a local label produces an address that has the Thumb bit cleared, which means the subsequent comparison is guaranteed to fail. Instead, use the badr macro, which forces the Thumb bit to be set. Fixes: a3ba87a61499 ("ARM: 6316/1: ftrace: add Thumb-2 support") Signed-off-by: Ard Biesheuvel Reviewed-by: Nick Desaulniers Reviewed-by: Steven Rostedt (Google) Reviewed-by: Linus Walleij Signed-off-by: Sasha Levin --- arch/arm/kernel/entry-ftrace.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kernel/entry-ftrace.S b/arch/arm/kernel/entry-ftrace.S index a74289ebc803..f4886fb6e9ba 100644 --- a/arch/arm/kernel/entry-ftrace.S +++ b/arch/arm/kernel/entry-ftrace.S @@ -40,7 +40,7 @@ mcount_enter ldr r0, =ftrace_trace_function ldr r2, [r0] - adr r0, .Lftrace_stub + badr r0, .Lftrace_stub cmp r0, r2 bne 1f -- 2.34.1