svn commit: r240003 - head/sys/kern
Mikolaj Golub
trociny at FreeBSD.org
Sun Sep 2 07:29:38 UTC 2012
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;
More information about the svn-src-head
mailing list