Re: Fwd: uprobes: register/unregister probes.

From: Peter Zijlstra
Date: Thu Nov 24 2011 - 11:35:22 EST


On Thu, 2011-11-24 at 20:21 +0530, Srikar Dronamraju wrote:
> > No you don't, you check the return value of igrab(), but you crash hard
> > when someone calls register_uprobe(.inode=NULL).
> >
>
> Okay. will add a check for inode before we do the igrab.

No!!! its fcking pointless calling this function without a valid inode
argument, don't mess about and try and deal with it.

Same with the consumer thing, if you call it with a NULL consumer you're
an idiot, try memcpy(NULL, foo, size), does that return -EINVAL?

Also, what's the point of all this igrab() nonsense? We don't need extra
references on the inode, the caller of these functions had better made
sure the inode is stable and good to use, otherwise it could be freed
before we do igrab() and we'd still crash.


--
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/