lkml.org 
[lkml]   [2021]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [syzbot] KASAN: stack-out-of-bounds Read in profile_pc
On Wed, Jun 02, 2021 at 04:35:11PM -0700, Andi Kleen wrote:
>
> > profile_pc() assumes the return address is either directly at regs->sp,
> > or one word adjacent to it due to saved flags, both of which are just
> > completely wrong. This code has probably never worked with ORC, and
> > nobody noticed apparently.
>
> I presume it used to work because the lock functions were really simple, but
> that's not true anymore.

Yeah, I figured as much.

> > We could just use ORC to unwind to the next frame. Though, isn't
> > /proc/profile redundant, compared to all the more sophisticated options
> > nowadays? Is there still a distinct use case for it or can we just
> > remove it?
>
> It's still needed for some special cases. For example there is no other
> viable way to profile early boot without a VM
>
> I would just drop the hack to unwind, at least for the early boot profile
> use case locking profiling is usually not needed.

Ok, I'll just get rid of the hack then.

--
Josh

\
 
 \ /
  Last update: 2021-06-03 15:30    [W:0.224 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site