* [PATCH 1/4] kgdboc,kgdbts: strlen() doesn't count the terminator
2011-03-25 21:44 [GIT PULL] kgdb/kdb tree for 2.6.39-rc1 Jason Wessel
@ 2011-03-25 21:44 ` Jason Wessel
2011-03-25 21:44 ` [PATCH 2/4] kdb: code cleanup to use macro instead of value Jason Wessel
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jason Wessel @ 2011-03-25 21:44 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, kgdb-bugreport, Dan Carpenter, Jason Wessel
From: Dan Carpenter <error27@gmail.com>
This is an off by one because strlen() doesn't count the null
terminator. We strcpy() these strings into an array of size
MAX_CONFIG_LEN.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
drivers/misc/kgdbts.c | 2 +-
drivers/tty/serial/kgdboc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
index 59c118c..27dc463 100644
--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -988,7 +988,7 @@ static void kgdbts_run_tests(void)
static int kgdbts_option_setup(char *opt)
{
- if (strlen(opt) > MAX_CONFIG_LEN) {
+ if (strlen(opt) >= MAX_CONFIG_LEN) {
printk(KERN_ERR "kgdbts: config string too long\n");
return -ENOSPC;
}
diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
index 25a8bc5..87e7e6c 100644
--- a/drivers/tty/serial/kgdboc.c
+++ b/drivers/tty/serial/kgdboc.c
@@ -131,7 +131,7 @@ static void kgdboc_unregister_kbd(void)
static int kgdboc_option_setup(char *opt)
{
- if (strlen(opt) > MAX_CONFIG_LEN) {
+ if (strlen(opt) >= MAX_CONFIG_LEN) {
printk(KERN_ERR "kgdboc: config string too long\n");
return -ENOSPC;
}
--
1.7.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/4] kdb: code cleanup to use macro instead of value
2011-03-25 21:44 [GIT PULL] kgdb/kdb tree for 2.6.39-rc1 Jason Wessel
2011-03-25 21:44 ` [PATCH 1/4] kgdboc,kgdbts: strlen() doesn't count the terminator Jason Wessel
@ 2011-03-25 21:44 ` Jason Wessel
2011-03-25 21:44 ` [PATCH 3/4] kgdb,x86_64: fix compile warning found with sparse Jason Wessel
2011-03-25 21:44 ` [PATCH 4/4] kdb: add usage string of 'per_cpu' command Jason Wessel
3 siblings, 0 replies; 5+ messages in thread
From: Jason Wessel @ 2011-03-25 21:44 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, kgdb-bugreport, Jovi Zhang, Jason Wessel
From: Jovi Zhang <bookjovi@gmail.com>
It's better to use macro KDB_BASE_CMD_MAX instead of 50
Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
kernel/debug/kdb/kdb_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index bd3e8e2..38a8542 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -78,7 +78,7 @@ static unsigned int kdb_continue_catastrophic;
static kdbtab_t *kdb_commands;
#define KDB_BASE_CMD_MAX 50
static int kdb_max_commands = KDB_BASE_CMD_MAX;
-static kdbtab_t kdb_base_commands[50];
+static kdbtab_t kdb_base_commands[KDB_BASE_CMD_MAX];
#define for_each_kdbcmd(cmd, num) \
for ((cmd) = kdb_base_commands, (num) = 0; \
num < kdb_max_commands; \
--
1.7.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/4] kgdb,x86_64: fix compile warning found with sparse
2011-03-25 21:44 [GIT PULL] kgdb/kdb tree for 2.6.39-rc1 Jason Wessel
2011-03-25 21:44 ` [PATCH 1/4] kgdboc,kgdbts: strlen() doesn't count the terminator Jason Wessel
2011-03-25 21:44 ` [PATCH 2/4] kdb: code cleanup to use macro instead of value Jason Wessel
@ 2011-03-25 21:44 ` Jason Wessel
2011-03-25 21:44 ` [PATCH 4/4] kdb: add usage string of 'per_cpu' command Jason Wessel
3 siblings, 0 replies; 5+ messages in thread
From: Jason Wessel @ 2011-03-25 21:44 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, kgdb-bugreport, Jason Wessel
Fix sparse warning:
arch/x86/kernel/kgdb.c:123:9: warning: switch with no cases
Reported-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
arch/x86/kernel/kgdb.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index a413000..3c2fb0f 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -121,8 +121,8 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
memcpy(mem, (void *)regs + dbg_reg_def[regno].offset,
dbg_reg_def[regno].size);
- switch (regno) {
#ifdef CONFIG_X86_32
+ switch (regno) {
case GDB_SS:
if (!user_mode_vm(regs))
*(unsigned long *)mem = __KERNEL_DS;
@@ -135,8 +135,8 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
case GDB_FS:
*(unsigned long *)mem = 0xFFFF;
break;
-#endif
}
+#endif
return dbg_reg_def[regno].name;
}
--
1.7.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 4/4] kdb: add usage string of 'per_cpu' command
2011-03-25 21:44 [GIT PULL] kgdb/kdb tree for 2.6.39-rc1 Jason Wessel
` (2 preceding siblings ...)
2011-03-25 21:44 ` [PATCH 3/4] kgdb,x86_64: fix compile warning found with sparse Jason Wessel
@ 2011-03-25 21:44 ` Jason Wessel
3 siblings, 0 replies; 5+ messages in thread
From: Jason Wessel @ 2011-03-25 21:44 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, kgdb-bugreport, Namhyung Kim, Jason Wessel
From: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
kernel/debug/kdb/kdb_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 38a8542..6bc6e3b 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2892,7 +2892,7 @@ static void __init kdb_inittab(void)
"Send a signal to a process", 0, KDB_REPEAT_NONE);
kdb_register_repeat("summary", kdb_summary, "",
"Summarize the system", 4, KDB_REPEAT_NONE);
- kdb_register_repeat("per_cpu", kdb_per_cpu, "",
+ kdb_register_repeat("per_cpu", kdb_per_cpu, "<sym> [<bytes>] [<cpu>]",
"Display per_cpu variables", 3, KDB_REPEAT_NONE);
kdb_register_repeat("grephelp", kdb_grep_help, "",
"Display help on | grep", 0, KDB_REPEAT_NONE);
--
1.7.1
^ permalink raw reply [flat|nested] 5+ messages in thread