* [PATCH rtw-next 1/3] wifi: rtlwifi: rtl8192ce: don't mark unencrypted frames as decrypted
2026-11-21 16:35 [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted frames as decrypted Zhao Li
@ 2026-11-21 16:35 ` Zhao Li
2026-11-23 6:14 ` Ping-Ke Shih
2026-11-21 16:35 ` [PATCH rtw-next 2/3] wifi: rtlwifi: rtl8192se: " Zhao Li
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Zhao Li @ 2026-11-21 16:35 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: Hemanth Selam, Morning Star, linux-wireless, linux-kernel, stable,
Zhao Li
The receive descriptor's SWDEC bit is set when a frame still needs
software decryption. It is also clear for a frame that was never
encrypted. rtl92ce_rx_query_desc() nevertheless sets RX_FLAG_DECRYPTED
for every frame with SWDEC clear except a protected robust management
frame, including unprotected data and management frames.
mac80211 then accepts an unprotected unicast data frame although a
pairwise key is installed, because ieee80211_drop_unencrypted() passes
frames marked as decrypted, and it accepts unprotected deauthentication
and disassociation frames on a connection that uses management frame
protection. A station in radio range can therefore inject plaintext
data into an encrypted connection, or end a protected one, by spoofing
the peer's address.
Set the flag only for a protected frame that is not a robust management
frame, as the rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be and rtl8821ae
drivers do. rtw88 dropped the same assumption in commit 0649ff58a0f6
("rtw88: Don't set RX_FLAG_DECRYPTED if packet has no encryption").
Found by code review. Compile-tested with W=1.
Fixes: 0c8173385e54 ("rtl8192ce: Add new driver")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
---
No new W=1, sparse or smatch warnings.
834fc28d7880 (7.4-rc1) fixed "managment" in the comment this patch removes;
with the old spelling in the removed lines it applies to 5.10.y through 7.3.y.
AI assistance was used.
.../wireless/realtek/rtlwifi/rtl8192ce/trx.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
index 99472053ccff..3d11ddf86136 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
@@ -300,20 +300,13 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
rx_status->flag |= RX_FLAG_MACTIME_START;
- /* hw will set stats->decrypted true, if it finds the
- * frame is open data frame or mgmt frame.
- * So hw will not decryption robust management frame
- * for IEEE80211w but still set status->decrypted
- * true, so here we should set it back to undecrypted
- * for IEEE80211w frame, and mac80211 sw will help
- * to decrypt it
- */
+ /* SWDEC is clear for plaintext too; mac80211 decrypts robust mgmt */
if (stats->decrypted) {
- if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
- (ieee80211_has_protected(hdr->frame_control)))
- rx_status->flag &= ~RX_FLAG_DECRYPTED;
- else
+ if (ieee80211_has_protected(hdr->frame_control) &&
+ !_ieee80211_is_robust_mgmt_frame(hdr))
rx_status->flag |= RX_FLAG_DECRYPTED;
+ else
+ rx_status->flag &= ~RX_FLAG_DECRYPTED;
}
/* rate_idx: index of data rate into band's
* supported rates or MCS index if HT rates
--
2.56.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* RE: [PATCH rtw-next 1/3] wifi: rtlwifi: rtl8192ce: don't mark unencrypted frames as decrypted
2026-11-21 16:35 ` [PATCH rtw-next 1/3] wifi: rtlwifi: rtl8192ce: " Zhao Li
@ 2026-11-23 6:14 ` Ping-Ke Shih
0 siblings, 0 replies; 8+ messages in thread
From: Ping-Ke Shih @ 2026-11-23 6:14 UTC (permalink / raw)
To: Zhao Li
Cc: Hemanth Selam, Morning Star, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Zhao Li <enderaoelyther@gmail.com> wrote:
> The receive descriptor's SWDEC bit is set when a frame still needs
> software decryption. It is also clear for a frame that was never
> encrypted. rtl92ce_rx_query_desc() nevertheless sets RX_FLAG_DECRYPTED
> for every frame with SWDEC clear except a protected robust management
> frame, including unprotected data and management frames.
This is what the comment says, but you are going to remove.
>
> mac80211 then accepts an unprotected unicast data frame although a
> pairwise key is installed, because ieee80211_drop_unencrypted() passes
> frames marked as decrypted, and it accepts unprotected deauthentication
> and disassociation frames on a connection that uses management frame
> protection. A station in radio range can therefore inject plaintext
> data into an encrypted connection, or end a protected one, by spoofing
> the peer's address.
For data frame, will hardware fail to do decryption and flag sw dec?
>
> Set the flag only for a protected frame that is not a robust management
> frame, as the rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be and rtl8821ae
> drivers do.
I think the purpose of this patch is to align the behavior of all chips,
right?
Maybe, we can just move the chunk setting RX_FLAG_DECRYPTED into an
inline function, and all chips call it.
The commit subject/message can be simple that
"Unify the setting of RX_FLAG_DECRYPTED".
> rtw88 dropped the same assumption in commit 0649ff58a0f6
> ("rtw88: Don't set RX_FLAG_DECRYPTED if packet has no encryption").
The commit is to add missed ENC type, but 8192ce doesn't have the field, no?
>
> Found by code review. Compile-tested with W=1.
>
> Fixes: 0c8173385e54 ("rtl8192ce: Add new driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
> ---
> No new W=1, sparse or smatch warnings.
>
> 834fc28d7880 (7.4-rc1) fixed "managment" in the comment this patch removes;
> with the old spelling in the removed lines it applies to 5.10.y through 7.3.y.
>
> AI assistance was used.
>
> .../wireless/realtek/rtlwifi/rtl8192ce/trx.c | 17 +++++------------
> 1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
> index 99472053ccff..3d11ddf86136 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
> @@ -300,20 +300,13 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
>
> rx_status->flag |= RX_FLAG_MACTIME_START;
>
> - /* hw will set stats->decrypted true, if it finds the
> - * frame is open data frame or mgmt frame.
> - * So hw will not decryption robust management frame
> - * for IEEE80211w but still set status->decrypted
> - * true, so here we should set it back to undecrypted
> - * for IEEE80211w frame, and mac80211 sw will help
> - * to decrypt it
> - */
> + /* SWDEC is clear for plaintext too; mac80211 decrypts robust mgmt */
> if (stats->decrypted) {
> - if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
> - (ieee80211_has_protected(hdr->frame_control)))
> - rx_status->flag &= ~RX_FLAG_DECRYPTED;
> - else
> + if (ieee80211_has_protected(hdr->frame_control) &&
> + !_ieee80211_is_robust_mgmt_frame(hdr))
> rx_status->flag |= RX_FLAG_DECRYPTED;
> + else
> + rx_status->flag &= ~RX_FLAG_DECRYPTED;
> }
The subject "wifi: rtlwifi: rtl8192ce: don't mark unencrypted frames as decrypted"
isn't clear to me. Which one is 'unencrypted'? and which one is 'decrypted' ?
> /* rate_idx: index of data rate into band's
> * supported rates or MCS index if HT rates
> --
> 2.56.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH rtw-next 2/3] wifi: rtlwifi: rtl8192se: don't mark unencrypted frames as decrypted
2026-11-21 16:35 [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted frames as decrypted Zhao Li
2026-11-21 16:35 ` [PATCH rtw-next 1/3] wifi: rtlwifi: rtl8192ce: " Zhao Li
@ 2026-11-21 16:35 ` Zhao Li
2026-11-21 16:35 ` [PATCH rtw-next 3/3] wifi: rtlwifi: rtl8192cu: don't mark undecrypted " Zhao Li
2026-11-23 5:43 ` [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted " Ping-Ke Shih
3 siblings, 0 replies; 8+ messages in thread
From: Zhao Li @ 2026-11-21 16:35 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: Hemanth Selam, Morning Star, linux-wireless, linux-kernel, stable,
Zhao Li
The receive descriptor's SWDEC bit is set when a frame still needs
software decryption. It is also clear for a frame that was never
encrypted. rtl92se_rx_query_desc() nevertheless sets RX_FLAG_DECRYPTED
for every frame with SWDEC clear except a protected robust management
frame, including unprotected data and management frames.
mac80211 then accepts an unprotected unicast data frame although a
pairwise key is installed, because ieee80211_drop_unencrypted() passes
frames marked as decrypted, and it accepts unprotected deauthentication
and disassociation frames on a connection that uses management frame
protection. A station in radio range can therefore inject plaintext
data into an encrypted connection, or end a protected one, by spoofing
the peer's address.
Set the flag only for a protected frame that is not a robust management
frame, as the rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be and rtl8821ae
drivers do. rtw88 dropped the same assumption in commit 0649ff58a0f6
("rtw88: Don't set RX_FLAG_DECRYPTED if packet has no encryption").
Found by code review. Compile-tested with W=1.
Fixes: 84f494cef7d9 ("rtlwifi: rtl8192se: Merge TX and RX routines")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
---
No new W=1, sparse or smatch warnings.
834fc28d7880 (7.4-rc1) fixed "managment" in the comment this patch removes;
with the old spelling in the removed lines it applies to 5.10.y through 7.3.y.
AI assistance was used.
.../net/wireless/realtek/rtlwifi/rtl8192se/trx.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
index b057d035a3a8..663f7a5fc070 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
@@ -274,22 +274,16 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
rx_status->flag |= RX_FLAG_MACTIME_START;
- /* hw will set stats->decrypted true, if it finds the
- * frame is open data frame or mgmt frame,
- * hw will not decrypt robust management frame
- * for IEEE80211w but still set stats->decrypted
- * true, so here we should set it back to undecrypted
- * for IEEE80211w frame, and mac80211 sw will help
- * to decrypt it */
+ /* SWDEC is clear for plaintext too; mac80211 decrypts robust mgmt */
if (stats->decrypted) {
hdr = (struct ieee80211_hdr *)(skb->data +
stats->rx_drvinfo_size + stats->rx_bufshift);
- if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
- (ieee80211_has_protected(hdr->frame_control)))
- rx_status->flag &= ~RX_FLAG_DECRYPTED;
- else
+ if (ieee80211_has_protected(hdr->frame_control) &&
+ !_ieee80211_is_robust_mgmt_frame(hdr))
rx_status->flag |= RX_FLAG_DECRYPTED;
+ else
+ rx_status->flag &= ~RX_FLAG_DECRYPTED;
}
rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht,
--
2.56.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH rtw-next 3/3] wifi: rtlwifi: rtl8192cu: don't mark undecrypted frames as decrypted
2026-11-21 16:35 [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted frames as decrypted Zhao Li
2026-11-21 16:35 ` [PATCH rtw-next 1/3] wifi: rtlwifi: rtl8192ce: " Zhao Li
2026-11-21 16:35 ` [PATCH rtw-next 2/3] wifi: rtlwifi: rtl8192se: " Zhao Li
@ 2026-11-21 16:35 ` Zhao Li
2026-11-23 6:22 ` Ping-Ke Shih
2026-11-23 5:43 ` [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted " Ping-Ke Shih
3 siblings, 1 reply; 8+ messages in thread
From: Zhao Li @ 2026-11-21 16:35 UTC (permalink / raw)
To: Ping-Ke Shih
Cc: Hemanth Selam, Morning Star, linux-wireless, linux-kernel, stable,
Zhao Li
The receive descriptor's SWDEC bit is set when a frame still needs
software decryption. It is also clear for a frame that was never
encrypted, and for a protected robust management frame, which the
hardware leaves for software to decrypt. rtl92cu_rx_query_desc()
nevertheless sets RX_FLAG_DECRYPTED for every frame with SWDEC clear,
in two places.
mac80211 then accepts an unprotected unicast data frame although a
pairwise key is installed, and unprotected deauthentication and
disassociation frames on a connection that uses management frame
protection. For a protected robust management frame it skips software
decryption and MIC verification, so a forged frame is accepted and a
genuine encrypted one, such as an SA Query from the peer, reaches
mac80211 still encrypted. A station in radio range can therefore inject
plaintext data into an encrypted connection, or end a protected one, by
spoofing the peer's address.
Set the flag only for a protected frame that is not a robust management
frame, as the rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be and rtl8821ae
drivers do. rtl8xxxu, which supports the same chip, stopped trusting
SWDEC alone in commit cbfbb4ddbc85 ("wifi: rtl8xxxu: enable MFP support
with security flag of RX descriptor"). The header is read before the
receive path strips the driver info, so test the Protected bit first,
which needs only the frame control field, and read that only when the
URB holds it. When Protected is set, _ieee80211_is_robust_mgmt_frame()
also reads only frame_control.
Found by code review. Compile-tested with W=1.
Fixes: 29d00a3e46bb ("rtlwifi: rtl8192cu: Add routine trx")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
---
No new W=1, sparse or smatch warnings.
AI assistance was used.
.../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
index d6c35e8d02a5..aceedc37e5d2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
@@ -295,11 +295,14 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc8;
__le32 *pdesc = (__le32 *)pdesc8;
u32 phystatus = get_rx_desc_phy_status(pdesc);
+ struct ieee80211_hdr *hdr;
+ unsigned int hdr_off;
stats->length = (u16)get_rx_desc_pkt_len(pdesc);
stats->rx_drvinfo_size = (u8)get_rx_desc_drvinfo_size(pdesc) *
RX_DRV_INFO_SIZE_UNIT;
stats->rx_bufshift = (u8)(get_rx_desc_shift(pdesc) & 0x03);
+ hdr_off = stats->rx_drvinfo_size + stats->rx_bufshift;
stats->icv = (u16)get_rx_desc_icv(pdesc);
stats->crc = (u16)get_rx_desc_crc32(pdesc);
stats->hwerror = (stats->crc | stats->icv);
@@ -316,15 +319,18 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
rx_status->band = hw->conf.chandef.chan->band;
if (get_rx_desc_crc32(pdesc))
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
- if (!get_rx_desc_swdec(pdesc))
- rx_status->flag |= RX_FLAG_DECRYPTED;
if (get_rx_desc_bw(pdesc))
rx_status->bw = RATE_INFO_BW_40;
if (get_rx_desc_rx_ht(pdesc))
rx_status->encoding = RX_ENC_HT;
rx_status->flag |= RX_FLAG_MACTIME_START;
- if (stats->decrypted)
- rx_status->flag |= RX_FLAG_DECRYPTED;
+ if (stats->decrypted &&
+ skb->len >= hdr_off + sizeof(hdr->frame_control)) {
+ hdr = (struct ieee80211_hdr *)(skb->data + hdr_off);
+ if (ieee80211_has_protected(hdr->frame_control) &&
+ !_ieee80211_is_robust_mgmt_frame(hdr))
+ rx_status->flag |= RX_FLAG_DECRYPTED;
+ }
rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht,
false, stats->rate);
rx_status->mactime = get_rx_desc_tsfl(pdesc);
--
2.56.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* RE: [PATCH rtw-next 3/3] wifi: rtlwifi: rtl8192cu: don't mark undecrypted frames as decrypted
2026-11-21 16:35 ` [PATCH rtw-next 3/3] wifi: rtlwifi: rtl8192cu: don't mark undecrypted " Zhao Li
@ 2026-11-23 6:22 ` Ping-Ke Shih
0 siblings, 0 replies; 8+ messages in thread
From: Ping-Ke Shih @ 2026-11-23 6:22 UTC (permalink / raw)
To: Zhao Li
Cc: Hemanth Selam, Morning Star, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Zhao Li <enderaoelyther@gmail.com> wrote:
> The receive descriptor's SWDEC bit is set when a frame still needs
> software decryption. It is also clear for a frame that was never
> encrypted, and for a protected robust management frame, which the
> hardware leaves for software to decrypt. rtl92cu_rx_query_desc()
> nevertheless sets RX_FLAG_DECRYPTED for every frame with SWDEC clear,
> in two places.
>
> mac80211 then accepts an unprotected unicast data frame although a
> pairwise key is installed, and unprotected deauthentication and
> disassociation frames on a connection that uses management frame
> protection. For a protected robust management frame it skips software
> decryption and MIC verification, so a forged frame is accepted and a
> genuine encrypted one, such as an SA Query from the peer, reaches
> mac80211 still encrypted. A station in radio range can therefore inject
> plaintext data into an encrypted connection, or end a protected one, by
> spoofing the peer's address.
>
> Set the flag only for a protected frame that is not a robust management
> frame, as the rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be and rtl8821ae
> drivers do. rtl8xxxu, which supports the same chip, stopped trusting
> SWDEC alone in commit cbfbb4ddbc85 ("wifi: rtl8xxxu: enable MFP support
> with security flag of RX descriptor"). The header is read before the
> receive path strips the driver info, so test the Protected bit first,
> which needs only the frame control field, and read that only when the
> URB holds it. When Protected is set, _ieee80211_is_robust_mgmt_frame()
> also reads only frame_control.
Need to reduce commit message generated by LLM.
>
> Found by code review. Compile-tested with W=1.
>
> Fixes: 29d00a3e46bb ("rtlwifi: rtl8192cu: Add routine trx")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
> ---
> No new W=1, sparse or smatch warnings.
>
> AI assistance was used.
>
> .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
> index d6c35e8d02a5..aceedc37e5d2 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
> @@ -295,11 +295,14 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
> struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc8;
> __le32 *pdesc = (__le32 *)pdesc8;
> u32 phystatus = get_rx_desc_phy_status(pdesc);
> + struct ieee80211_hdr *hdr;
> + unsigned int hdr_off;
>
> stats->length = (u16)get_rx_desc_pkt_len(pdesc);
> stats->rx_drvinfo_size = (u8)get_rx_desc_drvinfo_size(pdesc) *
> RX_DRV_INFO_SIZE_UNIT;
> stats->rx_bufshift = (u8)(get_rx_desc_shift(pdesc) & 0x03);
> + hdr_off = stats->rx_drvinfo_size + stats->rx_bufshift;
> stats->icv = (u16)get_rx_desc_icv(pdesc);
> stats->crc = (u16)get_rx_desc_crc32(pdesc);
> stats->hwerror = (stats->crc | stats->icv);
> @@ -316,15 +319,18 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
> rx_status->band = hw->conf.chandef.chan->band;
> if (get_rx_desc_crc32(pdesc))
> rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
> - if (!get_rx_desc_swdec(pdesc))
> - rx_status->flag |= RX_FLAG_DECRYPTED;
> if (get_rx_desc_bw(pdesc))
> rx_status->bw = RATE_INFO_BW_40;
> if (get_rx_desc_rx_ht(pdesc))
> rx_status->encoding = RX_ENC_HT;
> rx_status->flag |= RX_FLAG_MACTIME_START;
> - if (stats->decrypted)
> - rx_status->flag |= RX_FLAG_DECRYPTED;
> + if (stats->decrypted &&
> + skb->len >= hdr_off + sizeof(hdr->frame_control)) {
> + hdr = (struct ieee80211_hdr *)(skb->data + hdr_off);
Use the same style as other:
hdr = (struct ieee80211_hdr *)(skb->data + status->rx_drvinfo_size
+ status->rx_bufshift);
> + if (ieee80211_has_protected(hdr->frame_control) &&
> + !_ieee80211_is_robust_mgmt_frame(hdr))
> + rx_status->flag |= RX_FLAG_DECRYPTED;
> + }
> rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht,
> false, stats->rate);
> rx_status->mactime = get_rx_desc_tsfl(pdesc);
> --
> 2.56.1
pw-bot: cr
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted frames as decrypted
2026-11-21 16:35 [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted frames as decrypted Zhao Li
` (2 preceding siblings ...)
2026-11-21 16:35 ` [PATCH rtw-next 3/3] wifi: rtlwifi: rtl8192cu: don't mark undecrypted " Zhao Li
@ 2026-11-23 5:43 ` Ping-Ke Shih
2026-11-23 5:47 ` Ping-Ke Shih
3 siblings, 1 reply; 8+ messages in thread
From: Ping-Ke Shih @ 2026-11-23 5:43 UTC (permalink / raw)
To: Zhao Li
Cc: Hemanth Selam, Morning Star, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Zhao Li <enderaoelyther@gmail.com> wrote:
> rtl8192d (rtl8192de/rtl8192du) is intentionally left untouched here:
> it checks the cipher reported in the RX descriptor, so unencrypted
> frames are not marked as decrypted. However, when a cipher is reported
> and SWDEC is clear, it still sets RX_FLAG_DECRYPTED for protected
> robust management frames. Ping-Ke, does RTL8192D decrypt those in
> hardware (or set SWDEC / report no cipher for them), or does it need a
> robust management frame exclusion too?
Per rtl92d_rx_query_desc()
stats->decrypted = !get_rx_desc_swdec(pdesc) &&
get_rx_desc_enc_type(pdesc) != RX_DESC_ENC_NONE;
if (stats->decrypted)
rx_status->flag |= RX_FLAG_DECRYPTED;
I remember this chip doesn't support PMF. For PMF packets, sw desc should be 0,
and enc type should be NONE. So original logic should handle this properly.
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted frames as decrypted
2026-11-23 5:43 ` [PATCH rtw-next 0/3] wifi: rtlwifi: don't mark unencrypted " Ping-Ke Shih
@ 2026-11-23 5:47 ` Ping-Ke Shih
0 siblings, 0 replies; 8+ messages in thread
From: Ping-Ke Shih @ 2026-11-23 5:47 UTC (permalink / raw)
To: Zhao Li
Cc: Hemanth Selam, Morning Star, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Ping-Ke Shih <pkshih@realtek.com> wrote:
> Zhao Li <enderaoelyther@gmail.com> wrote:
> > rtl8192d (rtl8192de/rtl8192du) is intentionally left untouched here:
> > it checks the cipher reported in the RX descriptor, so unencrypted
> > frames are not marked as decrypted. However, when a cipher is reported
> > and SWDEC is clear, it still sets RX_FLAG_DECRYPTED for protected
> > robust management frames. Ping-Ke, does RTL8192D decrypt those in
> > hardware (or set SWDEC / report no cipher for them), or does it need a
> > robust management frame exclusion too?
>
> Per rtl92d_rx_query_desc()
>
> stats->decrypted = !get_rx_desc_swdec(pdesc) &&
> get_rx_desc_enc_type(pdesc) != RX_DESC_ENC_NONE;
> if (stats->decrypted)
> rx_status->flag |= RX_FLAG_DECRYPTED;
>
> I remember this chip doesn't support PMF. For PMF packets, sw desc should be 0,
> and enc type should be NONE. So original logic should handle this properly.
>
Looking into patch 1/3, I'm not sure the sw dec part:
/* hw will set stats->decrypted true, if it finds the
* frame is open data frame or mgmt frame.
* So hw will not decryption robust management frame
* for IEEE80211w but still set status->decrypted
* true, so here we should set it back to undecrypted
* for IEEE80211w frame, and mac80211 sw will help
* to decrypt it
*/
I think a real hardware is needed to check the status.
^ permalink raw reply [flat|nested] 8+ messages in thread