This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Review patches of user space kprobe


>>-----Original Message-----
>>From: systemtap-owner@sourceware.org [mailto:systemtap-owner@sourceware.org] On Behalf Of Prasanna S Panchamukhi
>>Sent: 2006年1月5日 19:14
>>To: Zhang, Yanmin
>>Cc: systemtap@sources.redhat.com; Keshavamurthy, Anil S; Mao, Bibo
>>Subject: Re: Review patches of user space kprobe
>>
>>> >>+ */
>>> >>+static struct kprobe *get_uprobe_at(struct inode *inode, unsigned
>>> long offset)
>>> >>+{
>>> >>+	struct hlist_head *head;
>>> >>+	struct hlist_node *node;
>>> >>+	struct kprobe *p;
>>> >>+
>>> >>+	head = &kprobe_table[hash_long((unsigned long)inode * offset,
>>> >>+				       KPROBE_HASH_BITS)];
>>> >>+	hlist_for_each_entry(p, node, head, hlist) {
>>> >>+		if (p->pre_handler == aggr_pre_handler)
>>> >>+			return p;
>>> >>+		else {
>>> >>+			struct uprobe *user = container_of(p,
>>> >>+							struct uprobe,
>>> kp);
>>> Kprobe and uprobe share the same hash table. Does p here always point to
>>> uprobe?
>>
>>Check can be made before accessig uprobe.
>>if (!kernel_text_address((unsigned long)p->addr))
Incorrect. get_uprobe, the caller of get_uprobe_at, might be crazy. current_uprobe might be set as up and get_user_page(up) is called incorrectly. The logic is *not clear*.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]