Re: [PATCH v2 3/3] wifi: mwifiex: Sanity check tlv_len and tlv_bitmap_len

From: Kees Cook
Date: Fri Aug 25 2023 - 19:55:36 EST


On Fri, Aug 25, 2023 at 04:38:56PM -0700, Brian Norris wrote:
> On Fri, Aug 25, 2023 at 2:10 PM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> > On Thu, Aug 24, 2023 at 09:10:45PM -0600, Gustavo A. R. Silva wrote:
> > > + mwifiex_dbg(priv->adapter, WARN,
> > > + "TLV size (%zu) overflows event_buf buf_left=%d\n",
> > > + size_add(sizeof(tlv_rxba->header), tlv_len),
> > > + tlv_buf_left);
> >
> > With the suggested change to make this a warning and not dbg:
>
> mwifiex_dbg(..., WARN, ...) *is* a warning, not a debug message. Or at
> least, that's how it's used throughout this driver, even though it
> actually yields a dev_info()-level message, regardless of the 'mask'
> arg:

Oh duh. My eyes didn't get any further than "dbg". My bad! Yes, this is
good as-is. :) Sorry for the noise!

-Kees

--
Kees Cook