From owner-freebsd-bugs Tue Sep 28 2:10:17 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C38E915581 for ; Tue, 28 Sep 1999 02:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA48820; Tue, 28 Sep 1999 02:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Tue, 28 Sep 1999 02:10:02 -0700 (PDT) Message-Id: <199909280910.CAA48820@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Pierre Beyssac Subject: Re: kern/11988: recvmsg with a cmsghdr but no iovec is broken Reply-To: Pierre Beyssac Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/11988; it has been noted by GNATS. From: Pierre Beyssac To: FreeBSD-gnats-submit@freebsd.org Cc: dot@dotat.at, brian@Awfulhak.org Subject: Re: kern/11988: recvmsg with a cmsghdr but no iovec is broken Date: Tue, 28 Sep 1999 11:04:16 +0200 Hello, Here's a kernel patch that fixes the panic under -current. Could you try it on your system and tell me if it works for you? I'm still investigating the rest of the PR regarding how descriptor passing should work. Pierre Index: uipc_socket2.c =================================================================== RCS file: /usr/cvs/src/sys/kern/uipc_socket2.c,v retrieving revision 1.50 diff -u -r1.50 uipc_socket2.c --- uipc_socket2.c 1999/09/19 02:16:19 1.50 +++ uipc_socket2.c 1999/09/28 08:23:53 @@ -730,8 +730,15 @@ if (sb->sb_flags & SB_LOCK) panic("sbflush: locked"); - while (sb->sb_mbcnt && sb->sb_cc) + while (sb->sb_mbcnt) { + /* + * Don't call sbdrop(sb, 0) if the leading mbuf is non-empty: + * we would loop forever. Panic instead. + */ + if (!sb->sb_cc && (sb->sb_mb == NULL || sb->sb_mb->m_len)) + break; sbdrop(sb, (int)sb->sb_cc); + } if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt) panic("sbflush: cc %ld || mb %p || mbcnt %ld", sb->sb_cc, (void *)sb->sb_mb, sb->sb_mbcnt); } -- Pierre Beyssac pb@enst.fr To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message