From owner-freebsd-current Wed Nov 22 20:30:54 2000 Delivered-To: freebsd-current@freebsd.org Received: from clmboh1-smtp1.columbus.rr.com (clmboh1-smtp1.columbus.rr.com [65.24.0.110]) by hub.freebsd.org (Postfix) with ESMTP id 1922537B4C5; Wed, 22 Nov 2000 20:30:51 -0800 (PST) Received: from columbus.rr.com (dzerkel@dhcp065-024-166-103.columbus.rr.com [65.24.166.103]) by clmboh1-smtp1.columbus.rr.com (8.9.3/8.9.3) with ESMTP id XAA29589; Wed, 22 Nov 2000 23:27:30 -0500 (EST) Message-ID: <3A1C9D77.57A09D56@columbus.rr.com> Date: Wed, 22 Nov 2000 23:30:48 -0500 From: "Danny J. Zerkel" Organization: Zerkular Software X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: Russian, ru, en MIME-Version: 1.0 To: FreeBSD Current , dillon@FreeBSD.ORG Subject: COMPAT_SVR4 broken after uipc_syscalls commit (1.77) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The recent renaming of getsock() to holdsock() broke COMPAT_SVR4 (and MISC_FS). I have made a quick stab at fixing it up in src/sys/compat/svr4/svr4_stream.c, but I'm a little hesitent to figure out what is going on in src/sys/miscfs/portal/portal_vfsops.c. Note: I don't actually use COMPAT_SVR4 for anything, it just happened to be in my config and broke. Any way, here is a possible fix. -- Danny J. Zerkel dzerkel@columbus.rr.com --- svr4_stream.c.orig Thu Aug 31 18:54:05 2000 +++ svr4_stream.c Wed Nov 22 22:39:00 2000 @@ -162,7 +162,7 @@ struct uio ktruio; #endif - error = getsock(p->p_fd, s, &fp); + error = holdsock(p->p_fd, s, &fp); if (error) return (error); auio.uio_iov = mp->msg_iov; @@ -174,13 +174,17 @@ auio.uio_resid = 0; iov = mp->msg_iov; for (i = 0; i < mp->msg_iovlen; i++, iov++) { - if ((auio.uio_resid += iov->iov_len) < 0) + if ((auio.uio_resid += iov->iov_len) < 0) { + fdrop(fp, p); return (EINVAL); + } } if (mp->msg_name) { error = getsockaddr(&to, mp->msg_name, mp->msg_namelen); - if (error) + if (error) { + fdrop(fp, p); return (error); + } } else to = 0; if (mp->msg_control) { @@ -229,6 +233,7 @@ bad: if (to) FREE(to, M_SONAME); + fdrop(fp, p); return (error); } @@ -253,7 +258,7 @@ struct uio ktruio; #endif - error = getsock(p->p_fd, s, &fp); + error = holdsock(p->p_fd, s, &fp); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message