Date: Sun, 2 Sep 2012 07:29:37 +0000 (UTC) From: Mikolaj Golub <trociny@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r240003 - head/sys/kern Message-ID: <201209020729.q827Tb6s059835@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trociny Date: Sun Sep 2 07:29:37 2012 New Revision: 240003 URL: http://svn.freebsd.org/changeset/base/240003 Log: In soreceive_generic() when checking if the type of mbuf has changed check it for MT_CONTROL type too, otherwise the assertion "m->m_type == MT_DATA" below may be triggered by the following scenario: - the sender sends some data (MT_DATA) and then a file descriptor (MT_CONTROL); - the receiver calls recv(2) with a MSG_WAITALL asking for data larger than the receive buffer (uio_resid > hiwat). MFC after: 2 week Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Sep 2 05:01:10 2012 (r240002) +++ head/sys/kern/uipc_socket.c Sun Sep 2 07:29:37 2012 (r240003) @@ -1695,8 +1695,8 @@ dontblock: * examined ('type'), end the receive operation. */ SOCKBUF_LOCK_ASSERT(&so->so_rcv); - if (m->m_type == MT_OOBDATA) { - if (type != MT_OOBDATA) + if (m->m_type == MT_OOBDATA || m->m_type == MT_CONTROL) { + if (type != m->m_type) break; } else if (type == MT_OOBDATA) break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209020729.q827Tb6s059835>