lkml.org 
[lkml]   [2015]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: use-after-free in __perf_install_in_context

* Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:

> On Thu, Dec 10, 2015 at 10:02:51AM +0100, Peter Zijlstra wrote:
> > On Wed, Dec 09, 2015 at 07:54:35PM -0800, Alexei Starovoitov wrote:
> > > Freeing memory is a requirement regardless.
> > > Even when kernel running with kasan, there must be a way to stop
> > > stack collection and free that memory.
> > > You cannot treat kernel as your test program or 'device under test'.
> >
> > Relax, that is exactly what lockdep does. It cannot dynamically allocate
> > things because allocators use lock etc..
> >
> > Its fine to build up state for debug bits, esp. if its bounded, like the
> > number of unique callchains.
>
> except the code in question is doing unbounded alloc_pages()

Yes, but the trick is to still have a bound sized debug pool - which runs out of
entries gracefully.

Which in practice is plenty enough for most types of testing, and is a lot more
robust than any dynamic scheme.

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-12-11 09:21    [W:0.135 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site