From owner-freebsd-doc Sat Jul 28 13:20: 8 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8E20C37B405 for ; Sat, 28 Jul 2001 13:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f6SKK1H83302; Sat, 28 Jul 2001 13:20:01 -0700 (PDT) (envelope-from gnats) 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 ; 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 ; 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 To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: docs/29285: Ioctl(2) doesn't mention error EFAULT. Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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