All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: anthony.liu@mediatek.com
Cc: nbd@nbd.name, lorenzo@kernel.org, Leon.Yen@mediatek.com,
	Quan.Zhou@mediatek.com, Ryder.lee@mediatek.com,
	Sean.Wang@mediatek.com, emery.hsin@mediatek.com,
	jb.tsai@mediatek.com, kun.wu@mediatek.com,
	linux-mediatek@lists.infradead.org,
	linux-wireless@vger.kernel.org, litien.chang@mediatek.com,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] mt76: fix buffer overrun in pkt buffer
Date: Fri, 30 Oct 2026 07:57:20 +0300	[thread overview]
Message-ID: <auQjsDPP1PeJg5sV@stanley.mountain> (raw)
In-Reply-To: <20261020032201.568970-1-anthony.liu@mediatek.com>

On Tue, Oct 20, 2026 at 11:22:00AM +0800, anthony.liu@mediatek.com wrote:
> From: Anthony Liu <anthony.liu@mediatek.com>
> 
> The last patch (d4e5ca3483a0) addresses mt7928 F/W 4 byte-aligment
> requirement by reducing pkt buffer by 2 bytes, causing the chance
> of buffer overrun.
> 
> This patch reduces incoming skb length limit accordingly.
> 
> Fixes: d4e5ca3483a0 ("wifi: mt76: mt7928: makes struct beacon_tlv 4-byte aligned.")
> Signed-off-by: Anthony Liu <anthony.liu@mediatek.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202610172141.mmRmGqow-lkp@intel.com/
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> index 26cdb3f0a98a..131585b3359d 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> @@ -2479,7 +2479,7 @@ mt7925_mcu_uni_add_beacon_offload(struct mt792x_dev *dev,
>  		return -EINVAL;
>  	}
>  
> -	if (skb->len > 512) {
> +	if (skb->len > 510) {

I would probably use:

	if (skb->len > sizeof(req.beacon_tlv.pkt)) {

but, we do need to apply this patch in linux-next.

regards,
dan carpenter



  reply	other threads:[~2026-10-30  4:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20  3:22 [PATCH] mt76: fix buffer overrun in pkt buffer anthony.liu
2026-10-30  4:57 ` Dan Carpenter [this message]
2026-10-30  9:05   ` [PATCH v2] " Anthony Liu
2026-10-30 10:18     ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2026-10-30  9:41 [PATCH] " Anthony Liu (劉良棟)

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=auQjsDPP1PeJg5sV@stanley.mountain \
    --to=error27@gmail.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Quan.Zhou@mediatek.com \
    --cc=Ryder.lee@mediatek.com \
    --cc=Sean.Wang@mediatek.com \
    --cc=anthony.liu@mediatek.com \
    --cc=emery.hsin@mediatek.com \
    --cc=jb.tsai@mediatek.com \
    --cc=kun.wu@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=litien.chang@mediatek.com \
    --cc=lkp@intel.com \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.