diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 18:19:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 18:19:56 -0500 |
commit | 880188b2433c3af51fa006207d9b13c70d2e5938 (patch) | |
tree | 77376c0270e4e36f73a80856de798c6a89eeb96c /drivers/misc/kgdbts.c | |
parent | 9764757932ce26f139332f89d1d3b815e4cc56ab (diff) | |
parent | 7f8b7ed6f825c729332b8190aca55c6bf95b158e (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
kgdb: Always process the whole breakpoint list on activate or deactivate
kgdb: continue and warn on signal passing from gdb
kgdb,x86: do not set kgdb_single_step on x86
kgdb: allow for cpu switch when single stepping
kgdb,i386: Fix corner case access to ss with NMI watch dog exception
kgdb: Replace strstr() by strchr() for single-character needles
kgdbts: Read buffer overflow
kgdb: Read buffer overflow
kgdb,x86: remove redundant test
Diffstat (limited to 'drivers/misc/kgdbts.c')
-rw-r--r-- | drivers/misc/kgdbts.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c index e4ff50b95a5e..fcb6ec1af173 100644 --- a/drivers/misc/kgdbts.c +++ b/drivers/misc/kgdbts.c | |||
@@ -712,6 +712,12 @@ static int run_simple_test(int is_get_char, int chr) | |||
712 | 712 | ||
713 | /* End of packet == #XX so look for the '#' */ | 713 | /* End of packet == #XX so look for the '#' */ |
714 | if (put_buf_cnt > 3 && put_buf[put_buf_cnt - 3] == '#') { | 714 | if (put_buf_cnt > 3 && put_buf[put_buf_cnt - 3] == '#') { |
715 | if (put_buf_cnt >= BUFMAX) { | ||
716 | eprintk("kgdbts: ERROR: put buffer overflow on" | ||
717 | " '%s' line %i\n", ts.name, ts.idx); | ||
718 | put_buf_cnt = 0; | ||
719 | return 0; | ||
720 | } | ||
715 | put_buf[put_buf_cnt] = '\0'; | 721 | put_buf[put_buf_cnt] = '\0'; |
716 | v2printk("put%i: %s\n", ts.idx, put_buf); | 722 | v2printk("put%i: %s\n", ts.idx, put_buf); |
717 | /* Trigger check here */ | 723 | /* Trigger check here */ |
@@ -885,16 +891,16 @@ static void kgdbts_run_tests(void) | |||
885 | int nmi_sleep = 0; | 891 | int nmi_sleep = 0; |
886 | int i; | 892 | int i; |
887 | 893 | ||
888 | ptr = strstr(config, "F"); | 894 | ptr = strchr(config, 'F'); |
889 | if (ptr) | 895 | if (ptr) |
890 | fork_test = simple_strtol(ptr + 1, NULL, 10); | 896 | fork_test = simple_strtol(ptr + 1, NULL, 10); |
891 | ptr = strstr(config, "S"); | 897 | ptr = strchr(config, 'S'); |
892 | if (ptr) | 898 | if (ptr) |
893 | do_sys_open_test = simple_strtol(ptr + 1, NULL, 10); | 899 | do_sys_open_test = simple_strtol(ptr + 1, NULL, 10); |
894 | ptr = strstr(config, "N"); | 900 | ptr = strchr(config, 'N'); |
895 | if (ptr) | 901 | if (ptr) |
896 | nmi_sleep = simple_strtol(ptr+1, NULL, 10); | 902 | nmi_sleep = simple_strtol(ptr+1, NULL, 10); |
897 | ptr = strstr(config, "I"); | 903 | ptr = strchr(config, 'I'); |
898 | if (ptr) | 904 | if (ptr) |
899 | sstep_test = simple_strtol(ptr+1, NULL, 10); | 905 | sstep_test = simple_strtol(ptr+1, NULL, 10); |
900 | 906 | ||