Re: [RFC PATCH 0/5] x86/hw_breakpoint: protects more cpu entry data

From: Peter Zijlstra
Date: Mon May 25 2020 - 11:25:23 EST


On Mon, May 25, 2020 at 02:50:57PM +0000, Lai Jiangshan wrote:
> Hello
>
> The patchset is based on (tag: entry-v9-the-rest, tglx-devel/x86/entry).
> And it is complement of 3ea11ac991d
> ("x86/hw_breakpoint: Prevent data breakpoints on cpu_entry_area").
>
> After reading the code, we can see that more data needs to be protected
> against hw_breakpoint, otherwise it may cause
> dangerous/recursive/unwanted #DB.
>
>
> Lai Jiangshan (5):
> x86/hw_breakpoint: add within_area() to check data breakpoints
> x86/hw_breakpoint: Prevent data breakpoints on direct GDT
> x86/hw_breakpoint: Prevent data breakpoints on per_cpu cpu_tss_rw

I think we can actually get rid of that #DB IST stack frobbing, also see
patches linked below.

> x86/hw_breakpoint: Prevent data breakpoints on user_pcid_flush_mask

Should we disallow the full structure just to be sure?

> x86/hw_breakpoint: Prevent data breakpoints on debug_idt_table

That's going away, see:

https://lkml.kernel.org/r/20200522204738.645043059@xxxxxxxxxxxxx

But yes, nice!