mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Doruk Tan Ozturk <doruk@0sec.ai>, briannorris@chromium.org
Cc: francesco@dolcini.it, kees@kernel.org,
	linux-wireless@vger.kernel.org,  linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v4] wifi: mwifiex: validate HT/VHT capability and operation IE lengths
Date: Fri, 04 Sep 2026 12:04:00 +0200	[thread overview]
Message-ID: <bad8369e7e41339f443c0d018bfa7243e8c284b9.camel@sipsolutions.net> (raw)
In-Reply-To: <20260814134707.85925-1-doruk@0sec.ai>

On Fri, 2026-08-14 at 15:47 +0200, Doruk Tan Ozturk wrote:
> 
> Assisted-by: 0sec:multi-model

If you're going to use LLMs anyway, how about you ask another instance
to review your patches? :-)

>  - Use sizeof(*ptr) for the length checks instead of naming the struct
>    type, so a check cannot drift from the type the pointer is
>    dereferenced as. bcn_ht_cap/bcn_ht_oper/bcn_vht_cap/bcn_vht_oper/
>    oper_mode are all typed pointers.

> +++ b/drivers/net/wireless/marvell/mwifiex/util.c
> @@ -721,7 +721,7 @@ mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies,
>  
>  	ht_cap_ie = (void *)cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, ies,
>  					     ies_len);
> -	if (ht_cap_ie) {
> +	if (ht_cap_ie && ht_cap_ie->len >= sizeof(struct ieee80211_ht_cap)) {

missed that, ht_cap is in scope so can be sizeof(*ht_cap).

johannes

      reply	other threads:[~2026-09-04 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 13:47 Doruk Tan Ozturk
2026-09-04 10:04 ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bad8369e7e41339f443c0d018bfa7243e8c284b9.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=briannorris@chromium.org \
    --cc=doruk@0sec.ai \
    --cc=francesco@dolcini.it \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®