Skip to content

Commit 9c0aeb3

Browse files
committed
BUG/MEDIUM: stconn: Don't perform L7 retries with large buffer
L7 retries are buggy when a large buffer is used on the request channel. A memcpy is used to copy data from the request buffer into the L7 buffer. The L7 buffer is for now always a standard buffer. So if a larger buffer is used, this leads to a buffer overflow and crash the process. The Best way to fix the issue is to disable L7 retries when a large buffer was allocated for the request channel. In that case, we don't want to allocate an extra large buffer. No backport needed.
1 parent cd91838 commit 9c0aeb3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/stconn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ int sc_conn_send(struct stconn *sc)
14931493
* disable the l7 retries by setting
14941494
* l7_conn_retries to 0.
14951495
*/
1496-
if (s->txn->req.msg_state != HTTP_MSG_DONE)
1496+
if (s->txn->req.msg_state != HTTP_MSG_DONE || b_is_large(&oc->buf))
14971497
s->txn->flags &= ~TX_L7_RETRY;
14981498
else {
14991499
if (b_alloc(&s->txn->l7_buffer, DB_UNLIKELY) == NULL)

0 commit comments

Comments
 (0)