- register_kprobe is called with a valid address
- that address is at the beginning of an instruction.
So, IMO these address checks don't belong in register_kprobe.
> BTW, I have a stupid little sample char driver that reads in address/message
> pairs and then adds a probe that printk's the message at the address. This
> was just my way of learning how to use kprobes. Should I post it? I would
> love to get feedback on what I did wrong, but I hate to spam the list.
>
This driver gets input (address to put probe at) from user, like all user
this address needs to be validated, in this driver. I am writing a kernel
module on top of kprobes that interacts with the user and provides
higher level of functionality (similar to dprobes) than what is provided
by the raw kprobes interface. It is in this module that all the user input
including addresses are validated before calling register_kprobe.
Regards,
Vamsi.
-- Vamsi Krishna S. Linux Technology Center, IBM Software Lab, Bangalore. Ph: +91 80 5044959 Internet: vamsi@in.ibm.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/