Date: Tue, 28 Sep 1999 02:10:02 -0700 (PDT) From: Pierre Beyssac <beyssac@enst.fr> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/11988: recvmsg with a cmsghdr but no iovec is broken Message-ID: <199909280910.CAA48820@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/11988; it has been noted by GNATS. From: Pierre Beyssac <beyssac@enst.fr> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909280910.CAA48820>