]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h1-htx: Never copy more than the max data allowed during parsing
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 Feb 2023 15:49:06 +0000 (16:49 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Feb 2023 16:45:45 +0000 (17:45 +0100)
commitc9ec9bc8346783417fe732cc4d22a074dca263f1
treecf20166a84b0d4082e0d01cebe945a67ec6a1b1e
parente51891a01d1ca7ecbd45ccb7db18826f15d9c0fa
BUG/MEDIUM: h1-htx: Never copy more than the max data allowed during parsing

A bug during H1 data parsing may lead to copy more data than the maximum
allowed. The bug is an overflow on this max threshold when it is lower than
the size of an htx_blk structure.

At first glance, it means it is possible to not respsect the buffer's
reserve. So it may lead to rewrite errors but it may also block any progress
on the stream if the compression is enabled. In this case, the channel
buffer appears as full and the compression must wait for space to
proceed. Outside of any bug, it is only possible when there are outgoing
data to forward, so the compression filter just waits. Because of this bug,
there is nothing to forward. The buffer is just full of input data. Thus
nothing move and the stream is infinitly blocked.

To fix the bug, we must be sure to be able to create an HTX block of 1 byte
without exceeding the maximum allowed.

This patch should fix the issue #2053. It must be backported as far as 2.5.
src/h1_htx.c