Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1132597rwb; Fri, 23 Sep 2022 08:35:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6fjz6S1LakfEkoNTFDBnZsF6Ik1NaDIiBXo7ehqPoZsz4RSJ6s8RiKlwf+eGWThC4+E4oR X-Received: by 2002:a17:90b:3504:b0:202:7253:9b53 with SMTP id ls4-20020a17090b350400b0020272539b53mr10448885pjb.155.1663947306056; Fri, 23 Sep 2022 08:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663947306; cv=none; d=google.com; s=arc-20160816; b=opI7VhyUEN0Bm2W4MWx4Are1Wb57ohW2Gh06aqUr9O3+7Nvr+WdQ6t5o/m1rs/c3PT fgqzheynKzR8RyXCiZkMy6fFCGYqzo8KVR/PsT3oMgyvHzMcFNEcLPg5GGZAZ4K9r2ob IAFUyBfohxSds5aRqEzWtNEfDvstfhwjwGYgnXIO5KBmgtZ7ANTNplE0weKC19dx7o51 yS6QzGsw/eFjarQwJyzCBfCXddhR2rM0oY4OG1znsHkQ41mb0cLF2c3+udGErUnH4Y7+ 6jFjkBuiuWvIafu8ZADgoVyII/Et8Y49O7zzNNobBJUBAAmwT9Zkn7jl2ucN/J5YEFJM nMxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QRYSoXvcppTAlsEtQ+icFMv2LLPQFLzpbaoyE9skujU=; b=dmX2oe80lp6V7p2Ly79XB0ta2e9Bnu6oEwYAoFqaV6IJYXDRgOPWDRTgdiqBc44iB/ Kd14kEGhSU8G7F2nfyHPwf9JAF39KLPhJndjRaOBsunakokksAmsmRSm4Ptpx8Lvc9rF qt0q3JwhZ3+bCRrG4a7CEciXe5Nm3x+ArDsNIaD5JWrhO0ua+iPOqdjdCLsZMW/5BulT KCXwH0henYOInqNd7RnvX681TnZ1OCIyUtQiPVqqhzEsXz+/yAJ8e+daZ2LZhAHt+E0Y nQJ9FBGVAVkkOjJnpskTamWYVB4xeNVN80J9k2zhV1uS6f3x2D76u5fXJe7wXy/nb/4B YN1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JpTXzaf5; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p17-20020a631e51000000b0043bf053c72asi8843598pgm.483.2022.09.23.08.34.54; Fri, 23 Sep 2022 08:35:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JpTXzaf5; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232473AbiIWP3t (ORCPT + 62 others); Fri, 23 Sep 2022 11:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232601AbiIWP3p (ORCPT ); Fri, 23 Sep 2022 11:29:45 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F6FA23BC9 for ; Fri, 23 Sep 2022 08:29:42 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28NDv06n010009; Fri, 23 Sep 2022 15:29:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=QRYSoXvcppTAlsEtQ+icFMv2LLPQFLzpbaoyE9skujU=; b=JpTXzaf5JhgVB87RZ8fe8SDKablcwgWu9Gtcmux7UVbcwc7TUQXvmANP4rEqmWaSFCQI +Jy7TsfFaOV0A83vZUUSOX5KebDXUYoj59KlM4euO+r5mKOZUbev7MYGHtY+NotWodj4 0FcDOva3VxmTDgKoBOmSJHGxwTpFvF1aL+ysJFa/G3sXxg3mMgY9EMZ0G0ElHoBeGUVu dWBteqdGS2irqW5QHq2GjK61+zdCCp+HlsJaFDMvlY6WZb2BXQ9BYDbOT2ecBlZsNtkF Mcnh0yJKhHxeRT1NEDu0n/pJx64EDw8ej8DuazAoTPRflYkXge33KHYXK7m8GLP0L9vu zA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3js9vusae9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 15:29:36 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 28NFTZCQ031627 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 15:29:35 GMT Received: from [10.110.41.101] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Fri, 23 Sep 2022 08:29:35 -0700 Message-ID: Date: Fri, 23 Sep 2022 08:29:34 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH 4/5] brcmfmac: Update SSID of hidden AP while informing its bss to cfg80211 layer Content-Language: en-US To: "Lin Ian (CSSITB CSS ICW SW WFS / EE)" , Kalle Valo CC: , , , , , References: <20220914033620.12742-1-ian.lin@infineon.com> <20220914033620.12742-5-ian.lin@infineon.com> <87tu506mre.fsf@kernel.org> From: Jeff Johnson In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: VnIyLQwNVCuhsKaCxrVNeIyQWWYZDMgl X-Proofpoint-GUID: VnIyLQwNVCuhsKaCxrVNeIyQWWYZDMgl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-23_04,2022-09-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1011 suspectscore=0 bulkscore=0 spamscore=0 adultscore=0 mlxlogscore=812 impostorscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209230100 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 9/22/2022 6:52 PM, Lin Ian (CSSITB CSS ICW SW WFS / EE) wrote: > > > On 9/22/2022 12:44 PM, Kalle Valo wrote: >> Ian Lin writes: >> >>> From: Syed Rafiuddeen >>> >>> cfg80211 layer on DUT STA is disconnecting ongoing connection attempt >>> after >>> receiving association response, because cfg80211 layer does not have >>> valid >>> AP bss information. On association response event, brcmfmac communicates >>> the AP bss information to cfg80211 layer, but SSID seem to be empty >>> in AP >>> bss information, and cfg80211 layer prints kernel warning and then >>> disconnects the ongoing connection attempt. >>> >>> SSID is empty in SSID IE, but 'bi->SSID' contains a valid SSID, so >>> updating the SSID for hidden AP while informing its bss information >>> to cfg80211 layer. >>> >>> Signed-off-by: Syed Rafiuddeen >> Syed's email address in From does not match with s-o-b. >> >>> @@ -3032,6 +3033,12 @@ static s32 brcmf_inform_single_bss(struct >>> brcmf_cfg80211_info *cfg, >>>        notify_ielen = le32_to_cpu(bi->ie_length); >>>        bss_data.signal = (s16)le16_to_cpu(bi->RSSI) * 100; >>> >>> +     ssid = brcmf_parse_tlvs(notify_ie, notify_ielen, WLAN_EID_SSID); >>> +     if (ssid && ssid->data[0] == '\0' && ssid->len == bi->SSID_len) { >>> +             /* Update SSID for hidden AP */ >>> +             memcpy((u8 *)ssid->data, bi->SSID, bi->SSID_len); >>> +     } >> memcpy() takes a void pointer so the cast is not needed. > There should be a type casting since 'ssid' is a const pointer. > As you saw there will be build warning in PATCH v2 (sorry I didn't > notice that locally) > I will send PATCH v3 to restore type casting, is that ok? > writing through a const pointer seems broken. Should you instead remove the const qualifier from the declaration? const struct brcmf_tlv *ssid = NULL; if the problem is that brcmf_parse_tlvs() itself returns a const pointer, then I'd typecast during the assignment instead of the memcpy() call. also note the NULL initializer is unnecessary since it is always overwritten by the call to brcmf_parse_tlvs()