Subject: Re: IOCTL implementation and kernel/userland addresses
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 02/05/2005 12:49:37
> Would proc still be NULL if the IOCTL is called from a kernel thread
> ?

That depends on what the thread passes as the last argument to
VOP_IOCTL, surely?

I know that my diskwatch stuff uses in-kernel ioctls to control part of
the communication between it and the disk drivers, and it passes a nil
proc pointer specifically because it is impossible for userland to
generate such a call and thus any such call can be `trusted'.  But if
I'd wanted to I could have passed down curproc (or any other proc
pointer, for that matter) instead.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B