]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: ensure offset is properly set for STREAM frames
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 2 Feb 2023 15:45:07 +0000 (16:45 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 3 Feb 2023 08:46:55 +0000 (09:46 +0100)
commit1dac018d9fcae67bf750c359dcf6567e68f3d037
treef0c97afd47a05fa9c48169b4754787b20e193429
parent2216b0866e785f1fc2dcc3cecb66e9eeda045184
MINOR: quic: ensure offset is properly set for STREAM frames

Care must be taken when reading/writing offset for STREAM frames. A
special OFF bit is set in the frame type to indicate that the field is
present. If not set, it is assumed that offset is 0.

To represent this, offset field of quic_stream structure must always be
initialized with a valid value in regards with its frame type OFF bit.

The previous code has no bug in part because pool_zalloc() is used to
allocate quic_frame instances. To be able to use pool_alloc(), offset is
always explicitely set to 0. If a non-null value is used, OFF bit is set
at the same occasion. A new BUG_ON() statement is added on frame builder
to ensure that the caller has set OFF bit if offset is non null.

This should be backported up to 2.7.
src/mux_quic.c
src/quic_conn.c
src/quic_frame.c