From: Adi Prasan <itsadi2409@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
error27@gmail.com, Adi Prasan <itsadi2409@gmail.com>
Subject: [PATCH v2] staging: rtl8723bs: fix ie_length bound check in rtw_cfg80211_inform_bss
Date: Mon, 21 Sep 2026 16:55:27 +0000 [thread overview]
Message-ID: <20260921165527.1379-1-itsadi2409@gmail.com> (raw)
In-Reply-To: <20260920142849.294162-1-itsadi2409@gmail.com>
The buffer bound check in rtw_cfg80211_inform_bss() only verifies
that bssinf_len (ie_length + header size) does not exceed
MAX_BSSINFO_LEN (1000 bytes), but network.ies[] is only MAX_IE_SZ
(768) bytes. This allows ie_length values up to ~976 bytes to pass
the check while a subsequent memcpy() from network.ies still reads
only 768 valid bytes, and other paths that write to network.ies
consistently cap ie_length to MAX_IE_SZ.
Add an explicit check against MAX_IE_SZ so the bound matches the
actual size of network.ies.
Signed-off-by: Adi Prasan <itsadi2409@gmail.com>
Fixes: 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver")
---
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 3468d4114f60..27e7b8442d7b 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -219,7 +219,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
bssinf_len = pnetwork->network.ie_length + sizeof(struct ieee80211_hdr_3addr);
- if (bssinf_len > MAX_BSSINFO_LEN)
+ if (bssinf_len > MAX_BSSINFO_LEN || pnetwork->network.ie_length > MAX_IE_SZ)
goto exit;
{
--
2.43.0
next prev parent reply other threads:[~2026-09-21 16:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 14:28 [PATCH] staging: rtl8723bs: fix ie_length bound check in rtw_cfg80211_inform_bss Adi Prasan
2026-09-20 15:37 ` Greg KH
2026-09-21 5:13 ` Adi Prasan
2026-09-21 15:23 ` Dan Carpenter
2026-09-21 17:03 ` Adi Prasan
2026-09-22 7:48 ` Dan Carpenter
2026-09-21 16:55 ` Adi Prasan [this message]
2026-09-22 10:22 ` [PATCH v2] " Dan Carpenter
[not found] ` <CAAd6oEjAMrJjx6PLDE7jj5OsgbwFWU9Uoy=_UyO8w-5AyZCxqw@mail.gmail.com>
2026-10-02 7:25 ` Dan Carpenter
2026-10-02 14:06 ` [PATCH] " Adi Prasan
2026-10-02 14:04 ` [PATCH v3] " Adi Prasan
2026-10-02 14:52 ` Greg KH
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=20260921165527.1379-1-itsadi2409@gmail.com \
--to=itsadi2409@gmail.com \
--cc=error27@gmail.com \
--cc=gregkh@linuxfoundation.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 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.