FAILED: patch "[PATCH] staging: rtl8723bs: rtw_mlme: add bounds checks before" failed to apply to 6.6-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 88e994c57a79f62d5338231d8d37ee8dd98baffe
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026061552-hardcore-riverbed-10f6@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 88e994c57a79f62d5338231d8d37ee8dd98baffe Mon Sep 17 00:00:00 2001
From: Salman Alghamdi <[email protected]>
Date: Wed, 13 May 2026 23:34:40 +0300
Subject: [PATCH] staging: rtl8723bs: rtw_mlme: add bounds checks before
ie_length subtraction
Add guards to ensure ie_length is large enough before subtracting fixed IE offsets to prevent unsigned integer underflow.
drivers/staging/rtl8723bs/core/rtw_mlme.c +10 -4
@@ -604,6 +604,8 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network privacy = pnetwork->network.privacy;if (check_fwstate (pmlmepriv,WIFI_UNDER_WPS )) { +if (pnetwork->network.ie_length < _FIXED_IE_LENGTH_) +return false;if (rtw_get_wps_ie (pnetwork->network.ies + _FIXED_IE_LENGTH_, pnetwork->network.ie_length - _FIXED_IE_LENGTH_,NULL , &wps_ielen))return true;else
@@ -617,11 +619,15 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network bselected = false;if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { - p =rtw_get_ie (pnetwork->network.ies + _BEACON_IE_OFFSET_,WLAN_EID_RSN , &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_)); -if (p && ie_len >0 ) - bselected = true; -else +if (pnetwork->network.ie_length < _BEACON_IE_OFFSET_) { bselected = false; + }else { + p =rtw_get_ie (pnetwork->network.ies + _BEACON_IE_OFFSET_,WLAN_EID_RSN , &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_)); +if (p && ie_len >0 ) + bselected = true; +else + bselected = false; + } } }