Re: [PATCH v4 10/29] x86/die: Don't try to recover from an OOPS on a non-default stack

From: Borislav Petkov
Date: Sun Jul 03 2016 - 05:41:01 EST


On Sat, Jul 02, 2016 at 01:34:51PM -0500, Josh Poimboeuf wrote:
> The existing 'object_is_on_stack()' can probably be used:
>
> if (!object_is_on_stack(current_top_of_stack()))
> panic("...");
>
> Though that function isn't quite accurately named. It should really
> have 'task_stack' in its name, like 'object_is_on_task_stack()'. Or
> even better, something more concise like 'on_task_stack()'.

So I'm obviously missing something here:

object_is_on_stack() uses task_stack_page(current) -> task_struct.stack
while current_stack_pointer() reads %rsp directly.

I'm guessing %rsp and task_struct.stack are in sync?

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.