Skip to content

RFC x86/DB: protects more cpu entry data and

Lai Jiangshan lkml oe-kbuild-all 2 versions – Applied

Status from this message: The following commit has been merged into the x86/entry branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest7 patches 5 repliesApplied
  2. v1 RFC5 patches 2 repliesSuperseded

Changes in v2 from the cover letter

Protect the full cpu_tlbstate structure to be sure. Suggested
by Peter.
Drop the last patch of the V1 because debug_idt_table is removed
in Peter's patchset[3].
remove IST-shifting

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/7x86/hw_breakpoint: add within_area() to check data breakpointsarch/x86/kernel/hw_breakpoint.c+11 -20 replies
2/7x86/hw_breakpoint: Prevent data breakpoints on direct GDTarch/x86/kernel/hw_breakpoint.c+22 -80 replies
3/7x86/hw_breakpoint: Prevent data breakpoints on per_cpu cpu_tss_rwarch/x86/kernel/hw_breakpoint.c+13 -00 replies
4/7x86/hw_breakpoint: Prevent data breakpoints on user_pcid_flush_maskarch/x86/kernel/hw_breakpoint.c+11 -04 replies
5/7x86/entry: don't shift stack on #DBarch/x86/entry/entry_64.S arch/x86/kernel/asm-offsets_64.c+0 -181 reply
6/7x86/entry: is_debug_stack() don't check of DB1 stackarch/x86/kernel/nmi.c+1 -60 replies
7/7x86/entry: remove DB1 stack and DB2 hole from cpu entry areaarch/x86/include/asm/cpu_entry_area.h arch/x86/kernel/asm-offsets_64.c arch/x86/kernel/dumpstack_64.c +1 more+7 -230 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH V2 0/7] x86/DB: protects more cpu entry data and

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.

This patch also remove IST-shifting(patch 5-7). Because tglx work includes debug_enter() which disables nested #DB.
Patch 5-7 depends tglx'w work only by now; they don't depends on Peter's patchset[3], but this patch 6 should be discarded when they are mareged with Peter's work.

Actually, I beg/hope Peter incorporate this V2 patchset into his patchset which will be incorporated to tglx work. Because this V2 patchset doesn't protect debug_idt_table and patch6 conflicts with Peter's work.

Changed from V1
Protect the full cpu_tlbstate structure to be sure. Suggested
by Peter.
Drop the last patch of the V1 because debug_idt_table is removed
in Peter's patchset[3].
remove IST-shifting

Lai Jiangshan (7):
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 x86/hw_breakpoint: Prevent data breakpoints on user_pcid_flush_mask x86/entry: don't shift stack on #DB
x86/entry: is_debug_stack() don't check of DB1 stack x86/entry: remove DB1 stack and DB2 hole from cpu entry area

 arch/x86/entry/entry_64.S             | 17 --------
 arch/x86/include/asm/cpu_entry_area.h | 12 ++---
 arch/x86/kernel/asm-offsets_64.c      |  5 ---
 arch/x86/kernel/dumpstack_64.c        | 10 ++---
 arch/x86/kernel/hw_breakpoint.c       | 63 +++++++++++++++++++++++----
 arch/x86/kernel/nmi.c                 |  7 +--
 arch/x86/mm/cpu_entry_area.c          |  4 +-
 7 files changed, 63 insertions(+), 55 deletions(-)
Signature · 1 line
2.20.1