-
Notifications
You must be signed in to change notification settings - Fork 268
Incoming TCP connections should not be added to the descriptor table until they're accept()ed #1780
Copy link
Copy link
Open
Labels
Type: BugError or flaw producing unexpected resultsError or flaw producing unexpected results
Description
When a listening socket receives a SYN packet, it immediately registers a new socket in the descriptor table.
shadow/src/main/host/descriptor/tcp.c
Lines 1931 to 1945 in 138b84a
| switch(tcp->state) { | |
| case TCPS_LISTEN: { | |
| /* receive SYN, send SYNACK, move to SYNRECEIVED */ | |
| if(header->flags & PTCP_SYN) { | |
| MAGIC_ASSERT(tcp->server); | |
| flags |= TCP_PF_PROCESSED; | |
| /* we need to multiplex a new child */ | |
| guint64 recvBufSize = host_getConfiguredRecvBufSize(host); | |
| guint64 sendBufSize = host_getConfiguredSendBufSize(host); | |
| TCP* multiplexed = tcp_new(host, recvBufSize, sendBufSize); | |
| process_registerLegacyDescriptor( | |
| descriptor_getOwnerProcess((LegacyDescriptor*)tcp), | |
| (LegacyDescriptor*)multiplexed); |
Shadow should wait and only register the socket in the descriptor table once the user space process calls accept().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: BugError or flaw producing unexpected resultsError or flaw producing unexpected results