Re: [PATCH] Kprobes: Verify probepoint in register_jprobe()
From: Paulo Marques
Date: Thu Jun 30 2005 - 09:16:32 EST
Luca Falavigna wrote:
[...]
int register_jprobe(struct jprobe *jp)
{
- /* Todo: Verify probepoint is a function entry point */
+ unsigned long size, offset;
+ char *modname, namebuf[KSYM_NAME_LEN+1];
+
+ kallsyms_lookup((unsigned long)jp->kp.addr, &size,
+ &offset, &modname, namebuf);
+
+ if(unlikely(offset))
+ return -EINVAL;
Hmmm, kallsyms_lookup might return NULL if either the address is not
found or CONFIG_KALLSYMS is not set, and in this case "offset" is not
initialized at all before this test.
We should either fail in this case, or accept the address as valid
without confirmation. I don't have sufficient knowledge about kprobes to
advise either way, but a test should be made nevertheless (or we could
just initialize "offset" to 0, if we want to accept the address without
confirmation).
--
Paulo Marques - www.grupopie.com
It is a mistake to think you can solve any major problems
just with potatoes.
Douglas Adams
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/