@@ -2405,9 +2405,9 @@ static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
2405
2405
2406
2406
static int ieee80211_drop_unencrypted_mgmt (struct ieee80211_rx_data * rx )
2407
2407
{
2408
- struct ieee80211_hdr * hdr = (struct ieee80211_hdr * )rx -> skb -> data ;
2409
2408
struct ieee80211_rx_status * status = IEEE80211_SKB_RXCB (rx -> skb );
2410
- __le16 fc = hdr -> frame_control ;
2409
+ struct ieee80211_mgmt * mgmt = (void * )rx -> skb -> data ;
2410
+ __le16 fc = mgmt -> frame_control ;
2411
2411
2412
2412
/*
2413
2413
* Pass through unencrypted frames if the hardware has
@@ -2416,6 +2416,11 @@ static int ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx)
2416
2416
if (status -> flag & RX_FLAG_DECRYPTED )
2417
2417
return 0 ;
2418
2418
2419
+ /* drop unicast protected dual (that wasn't protected) */
2420
+ if (ieee80211_is_action (fc ) &&
2421
+ mgmt -> u .action .category == WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION )
2422
+ return - EACCES ;
2423
+
2419
2424
if (rx -> sta && test_sta_flag (rx -> sta , WLAN_STA_MFP )) {
2420
2425
if (unlikely (!ieee80211_has_protected (fc ) &&
2421
2426
ieee80211_is_unicast_robust_mgmt_frame (rx -> skb ))) {
@@ -2458,6 +2463,12 @@ static int ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx)
2458
2463
if (unlikely (ieee80211_is_action (fc ) && !rx -> key &&
2459
2464
ieee80211_is_robust_mgmt_frame (rx -> skb )))
2460
2465
return - EACCES ;
2466
+
2467
+ /* drop unicast public action frames when using MPF */
2468
+ if (is_unicast_ether_addr (mgmt -> da ) &&
2469
+ ieee80211_is_public_action ((void * )rx -> skb -> data ,
2470
+ rx -> skb -> len ))
2471
+ return - EACCES ;
2461
2472
}
2462
2473
2463
2474
return 0 ;
0 commit comments