From owner-cvs-all Sun Oct 28 10:18:58 2001 Delivered-To: cvs-all@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 04EDF37B405; Sun, 28 Oct 2001 10:18:48 -0800 (PST) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f9SIIcB22447; Sun, 28 Oct 2001 13:18:38 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Sun, 28 Oct 2001 13:18:37 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: sobomax@FreeBSD.org Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: ports/devel/ORBit Makefile ports/devel/ORBit/files patch-src::IIOP::giop-msg-buffer.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 28 Oct 2001, Maxim Sobolev wrote: > > My local Linux box has: > > > > ... > > linux/uio.h: * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) > > ... > > #define UIO_MAXIOV 1024 > > #if 0 > > #define UIO_MAXIOV 16 /* Maximum iovec's in one operation > > 16 matches BSD */ > > /* Beg pardon: BSD has 1024 --ANK */ > > #endif > > I doubt that Linux is really enforces this limit, because if it does, > then the ORBit would be broken there as well. BTW, could you please do > me a favor and run the following program on your Linux box and send me > its output? It tests and reports real value of the limit. Here's the output: phoenix:/tmp/tmp> gcc -Wall -g -o o o.c o.c: In function `main': o.c:10: warning: implicit declaration of function `exit' o.c:13: warning: implicit declaration of function `close' phoenix:/tmp/tmp> ./o 16385 Interestingly, from the Linux source on that box: linux-2.4/fs/read_write.c: /* * First get the "struct iovec" from user memory and * verify all the pointers */ ret = 0; if (!count) goto out_nofree; ret = -EINVAL; if (count > UIO_MAXIOV) goto out_nofree; if (!file->f_op) goto out_nofree; if (count > UIO_FASTIOV) { ret = -ENOMEM; iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL); if (!iov) goto out_nofree; } So it really looks like, for a file readv or writev, it should reject high count values. Likewise the socket code: linux-2.4/net/socket.c: /* do not move before msg_sys is valid */ err = -EINVAL; if (msg_sys.msg_iovlen > UIO_MAXIOV) goto out_put; /* Check whether to allocate the iovec area*/ err = -ENOMEM; iov_size = msg_sys.msg_iovlen * sizeof(struct iovec); if (msg_sys.msg_iovlen > UIO_FASTIOV) { iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL); if (!iov) goto out_put; } Pointing it at a file instead of a device doesn't seem to make a difference. Not sure what to think :-). Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message