]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: quic: fix crash on MUX send notification
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 17 Aug 2022 14:33:13 +0000 (16:33 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Aug 2022 09:33:22 +0000 (11:33 +0200)
commit704675656bf8b577971f1bbc3be186f4cc362632
tree907bf9aabaa7011e67bd898d9b2749c358919717
parent4173a39c1fea29450a659292594df0cffcaa8d36
BUG/MEDIUM: quic: fix crash on MUX send notification

MUX notification on TX has been edited recently : it will be notified
only when sending its own data, and not for example on retransmission by
the quic-conn layer. This is subject of the patch :
  b29a1dc2f4a334c1c7fea76c59abb4097422c05c
  BUG/MINOR: quic: do not notify MUX on frame retransmit

A new flag QUIC_FL_CONN_RETRANS_LOST_DATA has been introduced to
differentiate qc_send_app_pkts invocation by MUX and directly by the
quic-conn layer in quic_conn_app_io_cb(). However, this is a first
problem as internal quic-conn layer usage is not limited to
retransmission. For example for NEW_CONNECTION_ID emission.

Another problem much important is that send functions are also called
through quic_conn_io_cb() which has not been protected from MUX
notification. This could probably result in crash when trying to notify
the MUX.

To fix both problems, quic-conn flagging has been inverted : when used
by the MUX, quic-conn is flagged with QUIC_FL_CONN_TX_MUX_CONTEXT. To
improve the API, MUX must now used qc_send_mux which ensure the flag is
set. qc_send_app_pkts is now static and can only be used by the
quic-conn layer.

This must be backported wherever the previously mentionned patch is.
include/haproxy/xprt_quic-t.h
include/haproxy/xprt_quic.h
src/mux_quic.c
src/xprt_quic.c