Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-16 Thread Mark Brown
On Fri, Apr 16, 2021 at 09:43:48AM -0500, Madhavan T. Venkataraman wrote: > How would you prefer I handle this? Should I place all SYM_CODE functions that > are actually safe for the unwinder in a separate section? I could just take > some approach and solve this. But I would like to get your

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-16 Thread Madhavan T. Venkataraman
On 4/14/21 5:23 AM, Madhavan T. Venkataraman wrote: > In any case, I have absolutely no problems in implementing your section idea. > I will > make an attempt to do that in version 3 of my patch series. So, I attempted a patch with just declaring all .entry.text functions as unreliable by

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-14 Thread Mark Brown
On Wed, Apr 14, 2021 at 05:23:38AM -0500, Madhavan T. Venkataraman wrote: > On 4/13/21 6:02 AM, Mark Brown wrote: > > On Mon, Apr 12, 2021 at 02:55:35PM -0500, Madhavan T. Venkataraman wrote: > >> 3. We are going to assume that the reliable unwinder is only for livepatch > >> purposes > >>

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-14 Thread Mark Brown
On Tue, Apr 13, 2021 at 05:53:10PM -0500, Josh Poimboeuf wrote: > On Mon, Apr 12, 2021 at 05:59:33PM +0100, Mark Brown wrote: > > Some more explict pointer to live patching as the only user would > > definitely be good but I think the more important thing would be writing > > down any assumptions

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-14 Thread Madhavan T. Venkataraman
On 4/13/21 6:02 AM, Mark Brown wrote: > On Mon, Apr 12, 2021 at 02:55:35PM -0500, Madhavan T. Venkataraman wrote: > >> >> OK. Just so I am clear on the whole picture, let me state my understanding >> so far. >> Correct me if I am wrong. > >> 1. We are hoping that we can convert a significant

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-13 Thread Josh Poimboeuf
On Mon, Apr 12, 2021 at 05:59:33PM +0100, Mark Brown wrote: > On Fri, Apr 09, 2021 at 05:32:27PM -0500, Josh Poimboeuf wrote: > > > Hm, for that matter, even without renaming things, a comment above > > stack_trace_save_tsk_reliable() describing the meaning of "reliable" > > would be a good idea.

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-13 Thread Mark Brown
On Mon, Apr 12, 2021 at 02:55:35PM -0500, Madhavan T. Venkataraman wrote: > > OK. Just so I am clear on the whole picture, let me state my understanding so > far. > Correct me if I am wrong. > 1. We are hoping that we can convert a significant number of SYM_CODE > functions to >SYM_FUNC

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-12 Thread Madhavan T. Venkataraman
On 4/12/21 12:36 PM, Mark Brown wrote: > On Fri, Apr 09, 2021 at 04:37:41PM -0500, Josh Poimboeuf wrote: >> On Fri, Apr 09, 2021 at 01:09:09PM +0100, Mark Rutland wrote: > >>> Further, I believe all the special cases are assembly functions, and >>> most of those are already in special sections

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-12 Thread Mark Brown
On Fri, Apr 09, 2021 at 04:37:41PM -0500, Josh Poimboeuf wrote: > On Fri, Apr 09, 2021 at 01:09:09PM +0100, Mark Rutland wrote: > > Further, I believe all the special cases are assembly functions, and > > most of those are already in special sections to begin with. I reckon > > it'd be simpler

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-12 Thread Mark Brown
On Fri, Apr 09, 2021 at 05:32:27PM -0500, Josh Poimboeuf wrote: > Hm, for that matter, even without renaming things, a comment above > stack_trace_save_tsk_reliable() describing the meaning of "reliable" > would be a good idea. Might be better to place something at the prototype for

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-11 Thread Madhavan T. Venkataraman
On 4/9/21 5:53 PM, Josh Poimboeuf wrote: > On Fri, Apr 09, 2021 at 05:32:27PM -0500, Josh Poimboeuf wrote: >> On Fri, Apr 09, 2021 at 05:05:58PM -0500, Madhavan T. Venkataraman wrote: FWIW, over the years we've had zero issues with encoding the frame pointer on x86. After you save

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-09 Thread Josh Poimboeuf
On Fri, Apr 09, 2021 at 05:32:27PM -0500, Josh Poimboeuf wrote: > On Fri, Apr 09, 2021 at 05:05:58PM -0500, Madhavan T. Venkataraman wrote: > > > FWIW, over the years we've had zero issues with encoding the frame > > > pointer on x86. After you save pt_regs, you encode the frame pointer to > > >

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-09 Thread Josh Poimboeuf
On Fri, Apr 09, 2021 at 05:05:58PM -0500, Madhavan T. Venkataraman wrote: > > FWIW, over the years we've had zero issues with encoding the frame > > pointer on x86. After you save pt_regs, you encode the frame pointer to > > point to it. Ideally in the same macro so it's hard to overlook. > > >

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-09 Thread Madhavan T. Venkataraman
On 4/9/21 4:37 PM, Josh Poimboeuf wrote: > On Fri, Apr 09, 2021 at 01:09:09PM +0100, Mark Rutland wrote: >> On Mon, Apr 05, 2021 at 03:43:09PM -0500, madve...@linux.microsoft.com wrote: >>> From: "Madhavan T. Venkataraman" >>> >>> There are a number of places in kernel code where the stack

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-09 Thread Josh Poimboeuf
On Fri, Apr 09, 2021 at 01:09:09PM +0100, Mark Rutland wrote: > On Mon, Apr 05, 2021 at 03:43:09PM -0500, madve...@linux.microsoft.com wrote: > > From: "Madhavan T. Venkataraman" > > > > There are a number of places in kernel code where the stack trace is not > > reliable. Enhance the unwinder

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-09 Thread Madhavan T. Venkataraman
On 4/9/21 7:09 AM, Mark Rutland wrote: > Hi Madhavan, > > I've noted some concerns below. At a high-level, I'm not keen on the > blacklisting approach, and I think there's some other preparatory work > that would be more valuable in the short term. > Some kind of blacklisting has to be done

Re: [RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-09 Thread Mark Rutland
Hi Madhavan, I've noted some concerns below. At a high-level, I'm not keen on the blacklisting approach, and I think there's some other preparatory work that would be more valuable in the short term. On Mon, Apr 05, 2021 at 03:43:09PM -0500, madve...@linux.microsoft.com wrote: > From: "Madhavan

[RFC PATCH v2 0/4] arm64: Implement stack trace reliability checks

2021-04-05 Thread madvenka
From: "Madhavan T. Venkataraman" There are a number of places in kernel code where the stack trace is not reliable. Enhance the unwinder to check for those cases and mark the stack trace as unreliable. Once all of the checks are in place, the unwinder can provide a reliable stack trace. But