Re: [RFC PATCH v2 00/20] arm64: livepatch: Use ORC for dynamic frame pointer validation

Madhavan T. Venkataraman
2022-05-29T15:30:16Z

Thanks for taking the time to review my patches.

On 5/24/22 09:24, Chen Zhongjin wrote:
> Hi Madvenka,
>
> I have a brief look at your patch and the idea that using CFA metadata to
> validate FP is reasonable to me. And I found a problem when I used 'pv dump' to
> check the orc value and I replied your commit 11/20 for that.
>

I have responded to that comment in another email. Please take a look.

> I think it's not necessary that you rewrite the arm64 decoder(there is already a
> decoder in my patch) and insn check(objtool check can just make it) by yourself.

>

This is a fair point. I will think about this a little bit and respond to this in a separate email.

> For me it's also a trouble that objtool runs too much unnecessary work. I advise
> that we should move some check for x86 as arch specific and refactor the cmdline
> options, they doesn't turn off everything perfectly now.
>

So, Josh has done what you have mentioned. He has reorganized all of that code.
I am working on syncing up to his changes. I will send out version 3.

> Other than that I have an advise: We only use orc for reliable stacktrace and
> normal FP unwind doesn't depends on it. Should we only load these data for
> livepatch (or other scenario needs reliable stacktrace)? It can save the memory
> and time consuming for kernel.
>

Yes. For ARM64, that is what I am trying to do. STACK_VALIDATION is optional and it
is off by default. It needs to be turned on only if reliable stack trace is required.

> That's all. And if you don't mind, can I incorporate some commit into my set?
> Appreciate for it.
>

Please feel free to use any and all of my code. I am also looking at merging our two
decoders so that there is only one decoder. I need to think about this a little bit.
So, stay tuned.

Thanks!

Madhavan