From: Randy Dunlap Date: Fri, 10 Jun 2011 20:33:24 +0000 (-0700) Subject: dtrace: fix off-by-one reading relocation info. X-Git-Tag: v4.1.12-92~313^2~190 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=80d58535c94005b68410dbfd2220e447eb3a8b63;p=users%2Fjedix%2Flinux-maple.git dtrace: fix off-by-one reading relocation info. Reading the dtrace relocation info table could fail on a boundary condition. Fix by counting the string terminator (null) byte. Now works for my 4 test cases. Signed-off-by: Randy Dunlap --- diff --git a/kernel/dtrace/sdt_register.c b/kernel/dtrace/sdt_register.c index 2a00c982491a..d91d19224989 100644 --- a/kernel/dtrace/sdt_register.c +++ b/kernel/dtrace/sdt_register.c @@ -107,7 +107,7 @@ void dtrace_register_builtins(void) __func__, ri->probe_name); nextri = (void *)ri + sizeof(struct reloc_info) - + roundup(ri->probe_name_len, BITS_PER_LONG / 8); + + roundup(ri->probe_name_len + 1, BITS_PER_LONG / 8); ri = nextri; DPRINTK("SDT relocs: next entry at 0x%p\n", ri); }