Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Ajay.Kathat@microchip.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wifi: wilc1000: avoid buffer overflow in WID string configuration
Date: Fri, 29 Aug 2025 22:40:04 +0300	[thread overview]
Message-ID: <aLICFFa8EG7EGXcG@stanley.mountain> (raw)
In-Reply-To: <20250829182241.45150-1-ajay.kathat@microchip.com>

On Fri, Aug 29, 2025 at 06:22:44PM +0000, Ajay.Kathat@microchip.com wrote:
> Fix the following copy overflow warning identified by Smatch static checker.
> 
>  drivers/net/wireless/microchip/wilc1000/wlan_cfg.c:184 wilc_wlan_parse_response_frame()
>         error: '__memcpy()' 'cfg->s[i]->str' copy overflow (512 vs 65537)
> 
> This patch introduces size check before accessing the memory buffer.
> The checks are base on the WID type of received data from the firmware.
> For WID string configuration, the size limit is determined by the maximum
> element size in 'struct wilc_cfg_str_vals'. Therefore, WILC_MAX_CFG_STR_SIZE
> macro is added to configure this size.
> 
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/linux-wireless/aLFbr9Yu9j_TQTey@stanley.mountain
> Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> ---

Thanks so much!

Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>

regards,
dan carpenter


      parent reply	other threads:[~2025-08-29 19:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 18:22 [PATCH] wifi: wilc1000: avoid buffer overflow in WID string configuration Ajay.Kathat
2025-08-29 19:30 ` Ajay.Kathat
2025-08-29 19:40 ` Dan Carpenter [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=aLICFFa8EG7EGXcG@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=Ajay.Kathat@microchip.com \
    --cc=linux-wireless@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