1: 68fb957be371 ! 1: 97baaa7dca6e wifi: rtw88: drop C2H packets shorter than the C2H header @@ Commit message Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Huihui Huang  + Reviewed-by: Luka Gejak   ## drivers/net/wireless/realtek/rtw88/fw.c ##  @@ drivers/net/wireless/realtek/rtw88/fw.c: void rtw_fw_c2h_cmd_rx_irqsafe(struct rtw_dev *rtwdev, u32 pkt_offset, 2: 9e5c9d9a5bc9 ! 2: 24de8d9b35a8 wifi: rtw88: check the C2H payload length before reading it @@ Commit message ignore C2H packets whose payload is too short for the fields the handler reads. For C2H_SCAN_RESULT, check the length before completing fw_scan_density, so that a report without payload does not wake the - waiter. + waiter. A short HW scan status report is not ignored but completes the + scan as aborted; otherwise the scan stays pending until something + aborts it.  For coexistence responses, this only validates the byte inspected by rtw_coex_info_response(). Length validation for the queued response's @@ drivers/net/wireless/realtek/rtw88/fw.c: void rtw_hw_scan_status_report(struct r if (!test_bit(RTW_FLAG_SCANNING, rtwdev->flags)) return;  -+ if (rtw_c2h_payload_len(skb) < 3) ++ if (rtw_c2h_payload_len(skb) < 3) { ++ rtw_hw_scan_complete(rtwdev, vif, true);  + return; ++ }  + c2h = get_c2h_from_skb(skb); rc = GET_SCAN_REPORT_RETURN_CODE(c2h->payload);