Re: [PATCH 00/10] x86: Various SYSENTER/SYSEXIT/#DB fixes and cleanups

From: Andy Lutomirski
Date: Mon Feb 29 2016 - 13:56:09 EST


On Sun, Feb 28, 2016 at 9:28 PM, Andy Lutomirski <luto@xxxxxxxxxx> wrote:
>
> While I was doing all this, I also noticed that DR6 and BTF handling
> in do_debug was a bit off. Two of the patches in here try to fix it
> up.

It's worth noting that do_debug is really quite screwed up with or
without this patchset applied. For example:

/*
* Let others (NMI) know that the debug stack is in use
* as we may switch to the interrupt stack.
*/
debug_stack_usage_inc();

/* It's safe to allow irq's after DR6 has been saved */
preempt_disable();
cond_local_irq_enable(regs);

This has never really been valid. It should be guarded by an
if(user_mode(regs)). And we need to kill the die_notifier garbage in
here -- it makes it basically impossible to understand what's going
on.

--Andy