[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e787031d-81fd-b1bc-4619-e8236a938d5c@linux.microsoft.com>
Date: Mon, 18 Apr 2022 13:38:51 -0500
From: "Madhavan T. Venkataraman" <madvenka@...ux.microsoft.com>
To: Josh Poimboeuf <jpoimboe@...hat.com>,
Chen Zhongjin <chenzhongjin@...wei.com>
Cc: mark.rutland@....com, broonie@...nel.org, ardb@...nel.org,
nobuta.keiya@...itsu.com, sjitindarsingh@...il.com,
catalin.marinas@....com, will@...nel.org, jmorris@...ei.org,
linux-arm-kernel@...ts.infradead.org,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v1 0/9] arm64: livepatch: Use DWARF Call Frame
Information for frame pointer validation
On 4/18/22 11:11, Josh Poimboeuf wrote:
> On Mon, Apr 18, 2022 at 08:28:33PM +0800, Chen Zhongjin wrote:
>> Hi Josh,
>>
>> IIUC, ORC on x86 can make reliable stack unwind for this scenario
>> because objtool validates BP state.
>>
>> I'm thinking that on arm64 there's no guarantee that LR will be pushed
>> onto stack. When we meet similar scenario on arm64, we should recover
>> (LR, FP) on pt_regs and continue to unwind the stack. And this is
>> reliable only after we validate (LR, FP).
>>
>> So should we track LR on arm64 additionally as track BP on x86? Or can
>> we just treat (LR, FP) as a pair? because as I know they are always set
>> up together.
>
> Does the arm64 unwinder have a way to detect kernel pt_regs on the
> stack? If so, the simplest solution is to mark all stacks with kernel
> regs as unreliable. That's what the x86 FP unwinder does.
>
AFAICT, only the task pt_regs can be detected. For detecting the other pt_regs,
we would have to set a bit in the FP. IIRC, I had a proposal where I set the LSB in
the FP stored on the stack. The arm64 folks did not like that approach as it
would be indistinguishable from a corrupted FP, however unlikely the corruption
may be.
Unwind hints can be used for these cases to unwind reliably through them. That is
probably the current thinking. Mark Rutland can confirm.
Madhavan
Powered by blists - more mailing lists