From p@i609.hadiko.de  Sat Jul 28 13:14:41 2001
Return-Path: <p@i609.hadiko.de>
Received: from mailgate.rz.uni-karlsruhe.de (mailgate.rz.uni-karlsruhe.de [129.13.64.97])
	by hub.freebsd.org (Postfix) with ESMTP id 654D937B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 28 Jul 2001 13:14:40 -0700 (PDT)
	(envelope-from p@i609.hadiko.de)
Received: from nce2.hadiko.de (hadince2.hadiko.uni-karlsruhe.de [172.20.32.2])
	by mailgate.rz.uni-karlsruhe.de with esmtp (Exim 3.16 #1)
	id 15QaTv-00075L-00; Sat, 28 Jul 2001 22:14:39 +0200
Received: from i609.hadiko.de (hadii609.hadiko.uni-karlsruhe.de [172.20.44.159])
	by nce2.hadiko.de (8.9.3/8.9.3) with ESMTP id WAA13471
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 28 Jul 2001 22:14:37 +0200 (MET DST)
Received: (from p@localhost)
	by i609.hadiko.de (8.11.4/8.11.4) id f6SKEa228115;
	Sat, 28 Jul 2001 22:14:36 +0200 (CEST)
	(envelope-from p)
Message-Id: <200107282014.f6SKEa228115@i609.hadiko.de>
Date: Sat, 28 Jul 2001 22:14:36 +0200 (CEST)
From: Philipp Mergenthaler <philipp.mergenthaler@stud.uni-karlsruhe.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Ioctl(2) doesn't mention error EFAULT.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         29285
>Category:       docs
>Synopsis:       Ioctl(2) doesn't mention error EFAULT.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 28 13:20:01 PDT 2001
>Closed-Date:    Mon Jul 30 17:08:51 PDT 2001
>Last-Modified:  Mon Jul 30 17:08:58 PDT 2001
>Originator:     Philipp Mergenthaler
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
University of Karlsruhe, Germany
>Environment:
System: FreeBSD i609.hadiko.de 5.0-CURRENT FreeBSD 5.0-CURRENT #416: Thu Jul 26 14:35:54 CEST 2001 p@i609.hadiko.de:/usr/obj/usr/sys/I609 i386


>Description:

Ioctl(2) should mention that ioctl will return a value of -1 and set
errno to EFAULT, when argp points to an illegal address.

>How-To-Repeat:

Looking at src/sys/kern/sys_generic.c, one sees that ioctl() passes an
error returned from copyin or copyout back to the user. Copy{in,out} can
return EFAULT, both according to their man page and to the code in
src/sys/i386/i386/support.s.

>Fix:

(In addition to the patch below I wonder whether mt(1) should be removed
from the manual page cross references. It doesn't look very helpful in
this context.)


Index: ioctl.2
===================================================================
RCS file: /ncvs/src/lib/libc/sys/ioctl.2,v
retrieving revision 1.12
diff -u -r1.12 ioctl.2
--- ioctl.2	2001/07/15 07:53:15	1.12
+++ ioctl.2	2001/07/28 20:12:03
@@ -131,6 +131,9 @@
 or
 .Fa argp
 is not valid.
+.It Bq Er EFAULT
+.Fa Argp
+points outside the process's allocated address space.
 .El
 .Sh SEE ALSO
 .Xr mt 1 ,
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dd 
State-Changed-When: Sun Jul 29 02:18:57 PDT 2001 
State-Changed-Why:  
Applied, thanks! 


Responsible-Changed-From-To: freebsd-doc->dd 
Responsible-Changed-By: dd 
Responsible-Changed-When: Sun Jul 29 02:18:57 PDT 2001 
Responsible-Changed-Why:  
My MFC reminder. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29285 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dd 
State-Changed-When: Mon Jul 30 17:08:51 PDT 2001 
State-Changed-Why:  
MFC'd 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29285 
>Unformatted:
