]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-h2: fix a possible crash on rxbuf allocation failure
authorWilly Tarreau <w@1wt.eu>
Mon, 12 Oct 2026 12:30:18 +0000 (14:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 Oct 2026 12:31:04 +0000 (14:31 +0200)
commit22eca878e9b9b9279ee0a3def827245960f63d75
treecf902bea0ae0a40c11931f4fae212df1a511f60a
parent4c085bd9fc343425fc3de491a60a901b1f428234
BUG/MEDIUM: mux-h2: fix a possible crash on rxbuf allocation failure

When receiving a large POST which spans multiple buffers, if the current
rxbuf is full we try to allocate a new buffer. But if the allocation
fails due to an enforced tune.buffers.limit for example, we leave and
try to switch back the buffer to htx via htx_to_buf(htx, scbuf) while
scbuf has become NULL, causing a crash.

Let's just properly reset the htx pointer between each buffer switch
so as not to attempt this operation. This is difficult to reproduce,
but could be triggered once with tune.buffers.limit set to 6, with
1 to 3 pending HTTP/1 requests and a 60kB H2 POST.

This was introduced in 3.1 by commit 4eb3ff1d3 ("MAJOR: mux-h2: make
streams use the connection's buffers"), so the fix must be backported
to 3.2.
src/mux_h2.c