MINOR: quic: Avoid cc priv buffer overflow.

Add two initcall callback with BUG_ON_HOT() to newro and cubic modules to
ensure there is no buffer overflow when accessing the private data of
these congestion control algorithm state structures. This is to ensure
that further modifications about these data structures will not
lead to surprises. At this time there is no possible buffer overflow.
This commit is contained in:
Frederic Lecaille 2024-07-24 11:07:19 +02:00
parent e902db2609
commit 735e4aecfc
2 changed files with 15 additions and 0 deletions

View File

@ -640,3 +640,11 @@ struct quic_cc_algo quic_cc_algo_cubic = {
.hystart_start_round = quic_cc_cubic_hystart_start_round,
.state_trace = quic_cc_cubic_state_trace,
};
void quic_cc_cubic_check(void)
{
struct quic_cc *cc;
BUG_ON_HOT(sizeof(struct cubic) > sizeof(cc->priv));
}
INITCALL0(STG_REGISTER, quic_cc_cubic_check);

View File

@ -223,3 +223,10 @@ struct quic_cc_algo quic_cc_algo_nr = {
.state_trace = quic_cc_nr_state_trace,
};
void quic_cc_nr_check(void)
{
struct quic_cc *cc;
BUG_ON_HOT(sizeof(struct nr) > sizeof(cc->priv));
}
INITCALL0(STG_REGISTER, quic_cc_nr_check);