]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic: fix race condition on datagram purging
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 25 Oct 2022 09:38:21 +0000 (11:38 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 27 Oct 2022 16:35:49 +0000 (18:35 +0200)
commit0b13e9407173c340d0b8d63c73ff07fdde5e889c
tree20b1825687ed06a762d89052ffa2abbedbdc5619
parent735b44f5df79705ade56d4569a9f05cf5d3cba41
BUG/MINOR: quic: fix race condition on datagram purging

Each datagram is received by a random thread and dispatch to its
destination thread linked to the connection. Then, the datagram is
handled by the connection thread. Once this is done, datagram buffer
pointer is atomically set to NULL to mark it as consumed.

Consumed datagrams are purged before recvfrom() invocation on random
receiver threads. The check for NULL buffer must thus be done
atomically. This was not the case before this patch, which may have
triggered race conditions.

This bug has been introduced by commit
  91b2305ad79bb7086840797b6e98bd791992444f
  MINOR: quic: implement datagram cleanup for quic_receiver_buf

This should be backported up to 2.6 after previously mentionned commit.
src/quic_sock.c