A data breakpoint on the IDT is terrifying and should be avoided. The IDT on CPU entry area is already protected. The debug IDT should be also protected, although it is seldom used and only used for short time.
Cc: Andy Lutomirski <l...@kernel.org> Cc: Peter Zijlstra (Intel) <pet...@infradead.org> Cc: Thomas Gleixner <t...@linutronix.de> Cc: x...@kernel.org Signed-off-by: Lai Jiangshan <la...@linux.alibaba.com> --- Please drop this patch when Peter's work to remove debug_idt_table is merged. arch/x86/kernel/hw_breakpoint.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index 9579bd6fb589..83d8b1fcbc76 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c @@ -284,6 +284,11 @@ static inline bool within_cpu_entry(unsigned long addr, unsigned long end) return true; } + /* debug_idt_table is used when load_debug_idt() */ + if (within_area(addr, end, (unsigned long)debug_idt_table, + sizeof(debug_idt_table[0]) * IDT_ENTRIES)) + return true; + return false; } -- 2.20.1