Comment 27 for bug 1958770

Revision history for this message
bsdz (blairuk) wrote :

Actually I took a look at the aq_nic.c and it looks like there are still places in the code that need patching to avoid UB. For example, from your dmesg I see it pointing to this section of code (https://github.com/torvalds/linux/blob/8d3a6c37d50d5a0504c126c932cc749e6dd9c78f/drivers/net/ethernet/aquantia/atlantic/aq_nic.c#L1267-L1269).

Which looks like this:

 for (i = 0U, aq_vec = self->aq_vec[0];
  self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i])
  aq_vec_stop(aq_vec);

And, to avoid UBSAN, should be rewritten as:

 for (i = 0U; self->aq_vecs > i; ++i) {
  aq_vec = self->aq_vec[i];
  aq_vec_stop(aq_vec);
        }

And, in fact, looks like there are another two places in that file that require the same treatment.