[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <164915122721.982637.1510683757540074397.stgit@devnote2>
Date: Tue, 5 Apr 2022 18:33:47 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Alexei Starovoitov <ast@...nel.org>,
Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Daniel Borkmann <daniel@...earbox.net>,
Shubham Bansal <illusionist.neo@...il.com>,
Andrii Nakryiko <andrii@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>, bpf@...r.kernel.org,
kernel-team@...com, Jiri Olsa <jolsa@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
"Naveen N . Rao" <naveen.n.rao@...ux.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
"David S . Miller" <davem@...emloft.net>,
linux-kernel@...r.kernel.org, Mark Rutland <mark.rutland@....com>,
Will Deacon <will@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH bpf 1/4] ARM: unwind: Initialize the lr_addr field of unwind_ctrl_block
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 <mhiramat@...nel.org>
---
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 */
Powered by blists - more mailing lists