From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A832C433EF for ; Tue, 5 Apr 2022 09:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bPq9W3as2eWd00zM/n8vgH2SHfLS+Rx4MfrTV4BFjPA=; b=Emz7nqiIDxt7l3 Ex+J5h+8KmeY5Q5+fGVHQ7e0JsIXamF80AsEjJlV4JV/afumlvZzwaAkbbhLx5MhcwdV7a6EyAOXA aNDV7+u1zAEMbzjuzompo715BU1AknGV339EIuq9+clTMpz9crmFDTrDCOfoFWbsxsbVhqA8rPJ0a udDV+wwY6iNGwrWrZkLPtgd+5fDu9pKCtTncWCF0VW259uwo6HqhRlibGTOSIseUxHy6S1vBbHI12 vj+Al8jRP5AkaQNwm77D/lniPdaF8LFgFseotFFoIwm0txF+j5lC6A7hso8LpTIbNpJw8oKvKJDcU pGNiRIDUe0QnO2FYG/fQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbfaJ-000S1p-NG; Tue, 05 Apr 2022 09:34:47 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbfZS-000RQv-Ba for linux-arm-kernel@lists.infradead.org; Tue, 05 Apr 2022 09:33:56 +0000 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 B187B6165C; Tue, 5 Apr 2022 09:33:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E16F6C385A6; Tue, 5 Apr 2022 09:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649151233; bh=68gbc2AXKSN3tRLzHyhrzyqpSc4gZP8dxeQpKcf9ezA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZcXmZ+AWPl+uE14MwKlMpmmcsKfi3t1I3TnC+TGAc4agrmtaPtWcGP6znqejd017 07Blju+cSqrhL4+m/2HwlI4Y+fS+YLVm8booS5rdL3RhK85mLr2vf2AScdCmCw0Z6m MDVvanNn0UbMNZpzKG99fYRC1Vd5Oddmv2dzjpmGkbTGPO5Mtd1P/XfvUgKSo+Aht7 KM5g6wH57uvRB93250SuWzyDBpAhSGZBUd2yTm/+ZsXQVdxVi14TQBhoc4PsJbJiX9 oMi0Xibos6mNUXNdrzd5Dj1CZxDA0qTvGetZgD6hNUH1f91L8z8bUrIIJjNnTIQaEE 1ybOAVUFVjtQg== From: Masami Hiramatsu To: Alexei Starovoitov , Alexei Starovoitov Cc: Daniel Borkmann , Shubham Bansal , Andrii Nakryiko , Masami Hiramatsu , bpf@vger.kernel.org, kernel-team@fb.com, Jiri Olsa , Steven Rostedt , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" , linux-kernel@vger.kernel.org, Mark Rutland , Will Deacon , Ard Biesheuvel , Russell King , Catalin Marinas , linux-arm-kernel@lists.infradead.org Subject: [PATCH bpf 1/4] ARM: unwind: Initialize the lr_addr field of unwind_ctrl_block Date: Tue, 5 Apr 2022 18:33:47 +0900 Message-Id: <164915122721.982637.1510683757540074397.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164915121498.982637.12787715964983738566.stgit@devnote2> References: <164915121498.982637.12787715964983738566.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220405_023354_515678_84015B4A X-CRM114-Status: GOOD ( 12.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since the unwind_ctrl_block::lr_addr is finally passed to stackframe::lr_addr, that value will be exposed unconditionally. Thus it should be initialized. Without this fix, when unwind_frame() doesn't update the unwind_ctrl_block::lr_addr (e.g. 'lr' register is not saved in the target function), stackframe::lr_addr will contain a wrong value. Signed-off-by: Masami Hiramatsu --- arch/arm/kernel/unwind.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index a37ea6c772cd..93e767682cf4 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -404,6 +404,7 @@ int unwind_frame(struct stackframe *frame) ctrl.vrs[SP] = frame->sp; ctrl.vrs[LR] = frame->lr; ctrl.vrs[PC] = 0; + ctrl.lr_addr = 0; if (idx->insn == 1) /* can't unwind */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 B2667C433EF for ; Wed, 6 Apr 2022 00:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1584418AbiDEX6Q (ORCPT ); Tue, 5 Apr 2022 19:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348399AbiDEJrh (ORCPT ); Tue, 5 Apr 2022 05:47:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BDD76E57B; Tue, 5 Apr 2022 02:33:54 -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 1D5D4616D2; Tue, 5 Apr 2022 09:33:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E16F6C385A6; Tue, 5 Apr 2022 09:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649151233; bh=68gbc2AXKSN3tRLzHyhrzyqpSc4gZP8dxeQpKcf9ezA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZcXmZ+AWPl+uE14MwKlMpmmcsKfi3t1I3TnC+TGAc4agrmtaPtWcGP6znqejd017 07Blju+cSqrhL4+m/2HwlI4Y+fS+YLVm8booS5rdL3RhK85mLr2vf2AScdCmCw0Z6m MDVvanNn0UbMNZpzKG99fYRC1Vd5Oddmv2dzjpmGkbTGPO5Mtd1P/XfvUgKSo+Aht7 KM5g6wH57uvRB93250SuWzyDBpAhSGZBUd2yTm/+ZsXQVdxVi14TQBhoc4PsJbJiX9 oMi0Xibos6mNUXNdrzd5Dj1CZxDA0qTvGetZgD6hNUH1f91L8z8bUrIIJjNnTIQaEE 1ybOAVUFVjtQg== From: Masami Hiramatsu To: Alexei Starovoitov , Alexei Starovoitov Cc: Daniel Borkmann , Shubham Bansal , Andrii Nakryiko , Masami Hiramatsu , bpf@vger.kernel.org, kernel-team@fb.com, Jiri Olsa , Steven Rostedt , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" , linux-kernel@vger.kernel.org, Mark Rutland , Will Deacon , Ard Biesheuvel , Russell King , Catalin Marinas , linux-arm-kernel@lists.infradead.org Subject: [PATCH bpf 1/4] ARM: unwind: Initialize the lr_addr field of unwind_ctrl_block Date: Tue, 5 Apr 2022 18:33:47 +0900 Message-Id: <164915122721.982637.1510683757540074397.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164915121498.982637.12787715964983738566.stgit@devnote2> References: <164915121498.982637.12787715964983738566.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the unwind_ctrl_block::lr_addr is finally passed to stackframe::lr_addr, that value will be exposed unconditionally. Thus it should be initialized. Without this fix, when unwind_frame() doesn't update the unwind_ctrl_block::lr_addr (e.g. 'lr' register is not saved in the target function), stackframe::lr_addr will contain a wrong value. Signed-off-by: Masami Hiramatsu --- arch/arm/kernel/unwind.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index a37ea6c772cd..93e767682cf4 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -404,6 +404,7 @@ int unwind_frame(struct stackframe *frame) ctrl.vrs[SP] = frame->sp; ctrl.vrs[LR] = frame->lr; ctrl.vrs[PC] = 0; + ctrl.lr_addr = 0; if (idx->insn == 1) /* can't unwind */