lkml.org 
[lkml]   [2017]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] kgdb,arm: Correct the macro used to define GDB register byte size
Date
From: Jimmy Durand Wesolowski <jwesolowski@de.adit-jv.com>

This patch corrects an issue introduced in the
commit 834b2964b7ab ("kgdb,arm: fix register dump"). The definition of
'NUMREGBYTES' was based on the number of the debug register number
('DBG_MAX_REG_NUM') instead of the memory space used to store them
('GDB_MAX_REGS').

The result was a kernel SIGSEGV signal when debugging with KGDB, with
'CONFIG_KGDB_KDB' disabled. When accessing the 23rd register of gdb_regs,
'dbg_get_reg' overwrote 'delayacct_cache' with '0's, leading later to the
crash.

Signed-off-by: Jimmy Durand Wesolowski <jwesolowski@de.adit-jv.com>
---
arch/arm/include/asm/kgdb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h
index 0a9d5dd..6949c7d 100644
--- a/arch/arm/include/asm/kgdb.h
+++ b/arch/arm/include/asm/kgdb.h
@@ -76,7 +76,7 @@ extern int kgdb_fault_expected;

#define KGDB_MAX_NO_CPUS 1
#define BUFMAX 400
-#define NUMREGBYTES (DBG_MAX_REG_NUM << 2)
+#define NUMREGBYTES (GDB_MAX_REGS << 2)
#define NUMCRITREGBYTES (32 << 2)

#define _R0 0
--
2.7.4
\
 
 \ /
  Last update: 2017-05-31 13:34    [W:0.055 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site