fa.openbsd.source-changes
[Top] [All Lists]

CVS: cvs.openbsd.org: src

Subject: CVS: cvs.openbsd.org: src
From: Theo de Raadt
Date: Mon, 24 Mar 2008 19:32:50 UTC
Newsgroups: fa.openbsd.source-changes

CVSROOT:        /cvs
Module name:    src
Changes by:     deraadt@xxxxxxxxxxxxxxx 2008/03/24 10:07:37

Modified files:
        sys/kern       : uipc_usrreq.c 

Log message:
We were led astray (like many others before us) to believe that
msg_controllen should be CMSG_LEN() instead of CMSG_SPACE() because
the kernel fd passing code was erroring out when
"cm->cmsg_len != control->m_len"
instead of
"CMSG_ALIGN(cm->cmsg_len) != control->m_len".
On machines with 16-byte alignment, when one thinks about how the ALIGN
padding happens, it is clear that msg_controllen has to be CMSG_SPACE()
or the kernel cannot hope to bounds check the messages correctly.
For now, change the check to cm->cmsg_len > control->m_len to permit the
old ABI to continue working.  Later perhaps when all the old binaries
are gone we can stop permitting their use.
lots of discussion with kettenis


<Prev in Thread] Current Thread [Next in Thread>