BUG/MINOR: mux-quic: fix crash with app ops install failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 19 Apr 2023 15:58:39 +0000 (17:58 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 20 Apr 2023 12:49:32 +0000 (14:49 +0200)
commited820823f0857af6a3d792ccb2a3d39bee86d401
tree9c036dc117f9caf5ff1f40e21c70080e7a9cb1a5
parentd07421331fff22ebacc44a8dd4b6f703502e69bf
BUG/MINOR: mux-quic: fix crash with app ops install failure

On MUX initialization, the application layer is setup via
qcc_install_app_ops(). If this function fails MUX is deallocated and an
error is returned.

This code path causes a crash before connection has been registered
prior into the mux_stopping_data::list for stopping idle frontend conns.
To fix this, insert the connection later in qc_init() once no error can
occured.

The crash was seen on the process closing with SUGUSR1 with a segfault
on mux_stopping_process(). This was reproduced using -dMfail.

This regression was introduced by the following patch :
  commit b4d119f0c75ce7c5a977ece18dc975e14f9b460c
  BUG/MEDIUM: mux-quic: fix crash on H3 SETTINGS emission

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