-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG/MEDIUM: quic: fix actconn on quic_conn alloc failure
Since the following commit, quic_conn instances are accounted into global actconn and compared against maxconn. commit 7735cf3 MEDIUM: quic: count quic_conn instance for maxconn Increment is always done prior to real allocation to guarantee minimal resource consumption. Special care is taken to ensure there will always be one decrement operation for each increment. To help this, decrement is centralized in quic_conn_release(). This behaves incorrectly in case of an intermediary allocation failure inside qc_new_conn(). In this case, quic_conn_release() will decrement actconn. Then, a NULL qc is returned in quic_rx_pkt_retrieve_conn() which will also decrement the counter on its own error code path. To properly fix this, actconn incrementation has been moved directly inside qc_new_conn(). It is thus easier to cover every cases : * if alloc failure before or on pool_head_quic_conn, actconn is decremented manually at the end of qc_new_conn() * after this step, actconn will be decremented by quic_conn_release() either on intermediary alloc failure or on proper connection release This bug happens on memory allocation failure so it should be rare. However, its impact is not negligeable as if actconn counter is wrapped it will block any future connection allocation for both QUIC and TCP. This must be backported up to 2.6.
- Loading branch information
1 parent
62812b2
commit d5a9093
Showing
2 changed files
with
31 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters