[PATCH] Variable-size ioctl data handling

John Baldwin jhb at freebsd.org
Tue Jan 22 20:11:05 UTC 2013


On Monday, January 21, 2013 3:26:21 pm Yuri wrote:
> Hi,
> 
> Could anybody please review and check in the patch 
> patch-ioctl-var-size.txt from this PR: 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=175425 ?
> This patch introduces the generic way to pass variable size ioctl 
> argument using the structure like this struct my_struct {int len; ...any 
> fields...}.

I think this layout is a bit of a special case.  I think you should just put 
the userland pointer in length in the structure you pass to the ioctl as mdf@ 
suggested in the thread on hackers at .  If nothing else, the length should be a 
size_t instead of an int.

-- 
John Baldwin


More information about the freebsd-current mailing list