-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue: 3594311 Fix segfault for delegate incoming handshake failure #180
issue: 3594311 Fix segfault for delegate incoming handshake failure #180
Conversation
2f20193
to
cfa56a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and regarding:
The handling of closing SYN_RCVD socket as part of handling FIN in sockinfo_tcp was removed, since we ignore FIN packets in SYN_RCVD state.
This socket closure will be done as part of "tcp_slowtmr - SYN_RCVD timeout"?
{ | ||
lock_tcp_con(); | ||
child_conn->unlock_tcp_con(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we leave the child_conn locked through the whole function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder: Remove accpted_conn loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed unneeded m_accepted_conn loop after setting m_parent=nullptr before putting the conenction into m_accepted_conn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do need to unlock child because we lock listen socket. It will work without, but it is not a good practice to have two locks acquired by the same thread.
bot:retest |
cfa56a0
to
34ac738
Compare
The case of FIN at SYN_RCVD state will be handled on timer. This is our current behavior until we decide to change that. RFC/Web do not state what exact behavior should implementation take in this case. |
bot:retest |
cfce2e8
to
51c2340
Compare
When delegate mode is enabled, incoming sockets with failed handshake are not closed immediately because in this mode socket object will be immediately destroyed in the middle of socket processing. This leads to access after destroy in related flows. Instead, we keep the socket in this list and the close() will be invoked as part of timers handling. We reuse the socket_fd_list_node_offset var to build the list, since this var is used for epoll and so guaranteed to be unused for half open sockets as application does not receive the fd for such sockets. The handling of closing SYN_RCVD socket as part of handling FIN in sockinfo_tcp was removed, since we ignore FIN packets in SYN_RCVD state. RFC https://datatracker.ietf.org/doc/html/rfc9293 does not state precisely how to handle this case. Call Hierarchy that may lead to termination of failed incoming connection: handle_incoming_handshake_failure: err_lwip_cb: L3_level_tcp_input - In order RST received tcp_slowtmr - SYN_RCVD timeout tcp_abandon: tcp_listen_input: - SYN-ACK enqueue failure L3_level_tcp_input tcp_pcb_reuse: - SYN-ACK enqueue failure tcp_timewait_input: L3_level_tcp_input tcp_abort: - Unrelated to incoming handshake failure L3_level_tcp_input tcp_process: L3_level_tcp_input sockinfo_tcp::abort_connection() Signed-off-by: Alexander Grissik <[email protected]>
The member sockinfo_tcp::m_received_syn_num is unused Signed-off-by: Alexander Grissik <[email protected]>
Removing precached variable to decrease sockinfo_tcp and CPU cache utilization. Signed-off-by: Alexander Grissik <[email protected]>
34ac738
to
d860bf0
Compare
Description
Seg fault fix for delegated timers and cleanups
What
See commit comments.
Why ?
Crash fix for Nginx Proxy
Change type
What kind of change does this PR introduce?
Check list