]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: fix off-by-one reading relocation info.
authorRandy Dunlap <randy.dunlap@oracle.com>
Fri, 10 Jun 2011 20:33:24 +0000 (13:33 -0700)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 29 Jun 2015 21:39:50 +0000 (22:39 +0100)
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 <randy.dunlap@oracle.com>
kernel/dtrace/sdt_register.c

index 2a00c982491af74d96cedf0e6974e1c0e3dedc9e..d91d19224989f2baecf00bce45eef3ea344c3433 100644 (file)
@@ -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);
        }