From owner-freebsd-current@FreeBSD.ORG Tue Jan 22 20:11:04 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E8810B82 for ; Tue, 22 Jan 2013 20:11:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id C736410D for ; Tue, 22 Jan 2013 20:11:04 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CED30B95B; Tue, 22 Jan 2013 15:11:03 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: [PATCH] Variable-size ioctl data handling Date: Tue, 22 Jan 2013 13:54:45 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <50FDA46D.6080105@rawbw.com> In-Reply-To: <50FDA46D.6080105@rawbw.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201301221354.45093.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Jan 2013 15:11:03 -0500 (EST) Cc: Yuri X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2013 20:11:05 -0000 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@. If nothing else, the length should be a size_t instead of an int. -- John Baldwin