The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Laxman Acharya Padhya <acharyalaxman8848@gmail.com>
Cc: Hans de Goede <hansg@kernel.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: validate WPS attribute lengths
Date: Sun, 2 Aug 2026 09:16:46 +0200	[thread overview]
Message-ID: <2026080235-reverse-water-861f@gregkh> (raw)
In-Reply-To: <20260801174611.49470-1-acharyalaxman8848@gmail.com>

On Sat, Aug 01, 2026 at 11:31:11PM +0545, Laxman Acharya Padhya wrote:
> rtw_get_wps_attr() checks that the four-byte attribute header fits in the
> WPS information element, but trusts the payload length from that header
> when copying the attribute and advancing to the next one. A malformed
> attribute can therefore make the driver read beyond a received management
> frame. Storing the total attribute length in u16 also allows the addition
> of the header size to wrap.
> 
> rtw_get_wps_attr_content() also copies the full payload without knowing
> the destination size. Its callers copy the Selected Registrar attribute
> into one-byte objects, so an oversized payload can overwrite the stack
> even when the payload itself fits inside the information element.
> 
> Store the total attribute length in u32 and reject attributes extending
> past the information element. Add destination lengths to the copy helpers
> and reject attributes that do not fit before copying them.
> 
> Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Laxman Acharya Padhya <acharyalaxman8848@gmail.com>

How was this found and tested?

thanks,

greg k-h

  reply	other threads:[~2026-08-02  7:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-01 17:46 [PATCH] staging: rtl8723bs: validate WPS attribute lengths Laxman Acharya Padhya
2026-08-02  7:16 ` Greg Kroah-Hartman [this message]
2026-08-02  8:12   ` Laxman Acharya Padhya
2026-08-02  8:16     ` Greg Kroah-Hartman

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=2026080235-reverse-water-861f@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=acharyalaxman8848@gmail.com \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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