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 Subject: docs/29285: Ioctl(2) doesn't mention error EFAULT. Message-ID: <200107282014.f6SKEa228115@i609.hadiko.de>
next in thread | raw e-mail | index | archive | help
>Number: 29285 >Category: docs >Synopsis: Ioctl(2) doesn't mention error EFAULT. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Sat Jul 28 13:20:01 PDT 2001 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107282014.f6SKEa228115>