From: Matt Mullins Date: Fri, 31 May 2019 19:47:54 +0000 (-0700) Subject: x86/kgdb: Return 0 from kgdb_arch_set_breakpoint() X-Git-Tag: v5.4-rc1~723^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71ab8323cc357c68985a2d6fc6cfc22b1dbbc1c3;p=platform%2Fkernel%2Flinux-rpi.git x86/kgdb: Return 0 from kgdb_arch_set_breakpoint() err must be nonzero in order to reach text_poke(), which caused kgdb to fail to set breakpoints: (gdb) break __x64_sys_sync Breakpoint 1 at 0xffffffff81288910: file ../fs/sync.c, line 124. (gdb) c Continuing. Warning: Cannot insert breakpoint 1. Cannot access memory at address 0xffffffff81288910 Command aborted. Fixes: 86a22057127d ("x86/kgdb: Avoid redundant comparison of patched code") Signed-off-by: Matt Mullins Signed-off-by: Borislav Petkov Reviewed-by: Nadav Amit Cc: Andy Lutomirski Cc: Christophe Leroy Cc: Daniel Thompson Cc: Douglas Anderson Cc: "Gustavo A. R. Silva" Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "Peter Zijlstra (Intel)" Cc: Rick Edgecombe Cc: Thomas Gleixner Cc: x86-ml Link: https://lkml.kernel.org/r/20190531194755.6320-1-mmullins@fb.com --- diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index 9a8c164..6690c56 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c @@ -758,7 +758,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) BREAK_INSTR_SIZE); bpt->type = BP_POKE_BREAKPOINT; - return err; + return 0; } int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)