Re: [RFC 0/5] kernel: backtrace unwind support

From: Benjamin Herrenschmidt
Date: Mon Feb 13 2012 - 21:23:07 EST


On Fri, 2012-02-10 at 12:37 -0800, Linus Torvalds wrote:
> On Fri, Feb 10, 2012 at 12:18 PM, Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> >
> > yep, looks interesting.. not sure about the mathematical proof though ;)
>
> Well, I can already say what the old code did horribly horribly wrong:
>
> - *all* stack accesses need to go through a validation function, they
> can never *ever* just try to access the stack.
>
> The validation function really needs to really check the full
> range of the stack area, not something random.
>
> - all dwarf information accesses need to similarly validate the
> access, and accept that sometimes the dwarf info is simply missing or
> actively wrong.

In addition it should all go through something like
copy_from_user_inatomic(), ie, all access to that stuff should have
built-in fault recovery without triggering high level page faults, stack
expansion etc...

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/