BUG/MINOR: qmux: do not crash on frame parsing issue
Some checks are pending
Contrib / admin/halog/ (push) Waiting to run
Contrib / dev/flags/ (push) Waiting to run
Contrib / dev/haring/ (push) Waiting to run
Contrib / dev/hpack/ (push) Waiting to run
Contrib / dev/poll/ (push) Waiting to run
VTest / Generate Build Matrix (push) Waiting to run
VTest / (push) Blocked by required conditions
Windows / Windows, gcc, all features (push) Waiting to run

Ensure frame parsing error does not cause a crash by removing the
associated BUG_ON()/ABORT_NOW().

For now, connection is flagged on error, which ensures that any
send/receive future operations are prevented and connection is closed
asap. In the future, a proper CONNECTION_CLOSE will be required as
defined by QMux protocol.

No need to backport.
This commit is contained in:
Amaury Denoyelle 2026-05-26 14:25:32 +02:00
parent b463072032
commit 2c0e633f6b

View file

@ -188,11 +188,10 @@ int qcc_qmux_recv(struct qcc *qcc)
buf_rec = b_make(b_orig(buf), b_size(buf),
b_head_ofs(buf), qcc->rx.rlen);
frm_ret = qmux_parse_frm(qcc, &buf_rec);
BUG_ON(frm_ret < 0); /* TODO handle fatal errors */
if (!frm_ret) {
/* emit FRAME_ENCODING_ERROR */
ABORT_NOW();
/* TODO implement proper connection closure */
conn->flags |= CO_FL_ERROR;
goto out;
}
/* A frame cannot be bigger than a record thanks to <buf_rec> delimitation. */