socket: Rename sb(un)lock() and interlock with listen(2)In preparation for moving sockbuf locks into the containing socket,provide alternative macros for the sockbuf I/O locks:SOCK_IO_SEND_(UN)LO
socket: Rename sb(un)lock() and interlock with listen(2)In preparation for moving sockbuf locks into the containing socket,provide alternative macros for the sockbuf I/O locks:SOCK_IO_SEND_(UN)LOCK() and SOCK_IO_RECV_(UN)LOCK(). These operate on asocket rather than a socket buffer. Note that these locks are used onlyto prevent concurrent readers and writters from interleaving I/O.When locking for I/O, return an error if the socket is a listeningsocket. Currently the check is racy since the sockbuf sx locks aredestroyed during the transition to a listening socket, but that will nolonger be true after some follow-up changes.Modify a few places to check for errors fromsblock()/SOCK_IO_(SEND|RECV)_LOCK() where they were not before. Inparticular, add checks to sendfile() and sorflush().Reviewed by: tuexen, gallatinSponsored by: The FreeBSD Foundation(cherry picked from commit f94acf52a408316ed61ba94705d7ec0a69ba5ec8)
show more ...
socket: De-duplicate SBLOCKWAIT() definitionsSponsored by: The FreeBSD Foundation(cherry picked from commit fa0463c384b652e1e962d5e8e70396e6a876f01b)
Consistently use the SOLISTENING() macroSome code was using it already, but in many places we were testingSO_ACCEPTCONN directly. As a small step towards fixing some bugsinvolving synchronizatio
Consistently use the SOLISTENING() macroSome code was using it already, but in many places we were testingSO_ACCEPTCONN directly. As a small step towards fixing some bugsinvolving synchronization with listen(2), make the kernel consistentlyuse SOLISTENING(). No functional change intended.Sponsored by: The FreeBSD Foundation(cherry picked from commit f4bb1869ddd2bca89b6b6bfaf4d866efdd9243cf)
Add missing sockaddr length and family validation to various protocolsSeveral protocol methods take a sockaddr as input. In some cases thesockaddr lengths were not being validated, or were valida
Add missing sockaddr length and family validation to various protocolsSeveral protocol methods take a sockaddr as input. In some cases thesockaddr lengths were not being validated, or were validated after someout-of-bounds accesses could occur. Add requisite checking to variousprotocol entry points, and convert some existing checks to assertionswhere appropriate.Reported by: syzkaller+KASANReviewed by: tuexen, melifaroSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D29519(cherry picked from commit f161d294b92732df6254a89f393ab24999e122bf)
Socket AF_HYPERV should return failure when it is not running on HyperVReported by: phoSponsored by: Microsoft
Fix i386 build for r361275kponsored by: The FreeBSD Foundation
HyperV socket implementation for FreeBSDThis change adds Hyper-V socket feature in FreeBSD. New socket addressfamily AF_HYPERV and its kernel support are added.Submitted by: Wei Hu <weh@microsof
HyperV socket implementation for FreeBSDThis change adds Hyper-V socket feature in FreeBSD. New socket addressfamily AF_HYPERV and its kernel support are added.Submitted by: Wei Hu <[email protected]>Reviewed by: Dexuan Cui <[email protected]>Relnotes: yesSponsored by: MicrosoftDifferential Revision: https://reviews.freebsd.org/D24061