Bug 230274 - linuxulator and cloudabi don't handle multiple mbufs in a control message chain
Summary: linuxulator and cloudabi don't handle multiple mbufs in a control message chain
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks: 247219
  Show dependency treegraph
 
Reported: 2018-08-01 23:21 UTC by Mark Johnston
Modified: 2020-07-01 16:47 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer 2018-08-01 23:21:54 UTC
cloudabi_sock_recv() and linux_recvmsg_common() use kern_recvit(), which may return control messages in addition to data.  Suppose one uses sendmsg() to transmit multiple SCM_RIGHTS messages in a single call.  When these messages are externalized, the unix socket code will place them in separate mbufs which get returned as a chain from kern_recvit().  From code inspection, some consumers only handle the first mbuf in the chain, so control messages will be dropped in some cases.
Comment 1 Alexander Leidinger freebsd_committer 2020-07-01 07:41:05 UTC
Hi,

Is there somewhere an example of what needs to be done for a person without much knowledge about the network code, but interest to get one or both of the emulation areas fixed?

Bye,
Alexander.
Comment 2 Mark Johnston freebsd_committer 2020-07-01 16:47:36 UTC
(In reply to Alexander Leidinger from comment #1)
You might compare handling of the "controlp == NULL" case in kern_recvit() with the handling of the "control != NULL" case in linux_recvmsg_common().  The former iterates over all mbufs in the chain, the latter does not.