Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp438898rdb; Sat, 19 Aug 2023 07:47:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSwjW7C/SPipZAHXOKpIIbgHK1wlEkJ1xzFls8wLp/raeSaz0Yg41fQXj32z/HWP5Okxpq X-Received: by 2002:a17:90a:6e4b:b0:269:34a6:d4ca with SMTP id s11-20020a17090a6e4b00b0026934a6d4camr2000884pjm.0.1692456448700; Sat, 19 Aug 2023 07:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692456448; cv=none; d=google.com; s=arc-20160816; b=uLKqdMQnqcj0ldwtORrK7QiG0nAFMD+vaWyOt4FPEobLOu6h+Mk0ORh5FKtJncrChU +YwbRtowcTjs3NsAtTbSyWmDfDV4BBdzq844W48H/uZOOPFNvx522Es2PKjL0FB9MXtN tN9lgKvss3IwJn5qhSyrBGxU5uzlHX3r0FuMGkF1EXcfKXMJLfmCw2yc8NMQpM6z5jz2 C640YVHEIs6G1UzP4HoG3wVxSTK8m2pLrD8H/qJ90ShwMruJ4s1m8BpaleVQNreXjVXy Msl091QuWVXpXURkMwV81Rb/L0O0GwP/faOVznqyNLxchJwX+pgmBtJ1+bBM7OlCTeQ1 sjCQ== 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=5p4UN0NasWWtwUDvgEghzv9AhE9oFggg3a5QgUnVUw4=; fh=OFJaPNHGJdLQQeK+q23uA3uwfeqo1PM5wbQu2zUVNYk=; b=OqXrHlhj45T5CJCzUdKvGzFjRoPIirMCzl9+zwETK4dmhLXidGGkeG/p0jgG7oiXFS hJaAEV+A/Qy5yAoqfV3c13oigr/uZZ/MUqAmsGwMaeEBVuus2R+rri+z7yGtKN1/7sJU pvXlrAuL/xbStlBwvI7fKD8vbOr3Jdf29K70aTGZoXSIIZazY7HaIw7dQyHNLU1lk87j 6NTpJjcLhLzlCrec7O8SzpFxKyJTG3T8ayCa1KuOfqZdETXdXNidCr6Ae8BLK+ssY7dx VDiR7gycwNuZaKYEfGHrs2VtT6rM/OMtDgiwaRRoaV2CEcCTwKGGaFFWPiDmlhe+2szZ gpEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JJcqUyFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l13-20020a17090a72cd00b0026b365096e5si4200631pjk.53.2023.08.19.07.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 07:47:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JJcqUyFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8BC64CFF97; Sat, 19 Aug 2023 01:44:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355755AbjHQWaw (ORCPT + 99 others); Thu, 17 Aug 2023 18:30:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355733AbjHQWaT (ORCPT ); Thu, 17 Aug 2023 18:30:19 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FCA730DA; Thu, 17 Aug 2023 15:30:17 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37HLp19o007187; Thu, 17 Aug 2023 22:03:45 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=5p4UN0NasWWtwUDvgEghzv9AhE9oFggg3a5QgUnVUw4=; b=JJcqUyFZccxAAQKcLKLwXo7BVu36AZGkfkFul+wMlP/fqdY4QWHQJK2IvYO79FfjEjq/ XZ4gHfCncN5r107+ksSIQ/6H5e6qdj5aiTuOu879I4gbC2P6wPeO1tktc+SFuNGA+Ayv VNO3Hfmmmw8lDxfVR/NqQoQtSHbvgzcrTupbKBS4btcaQmyyulcBdSsPlu49myDE/cJ0 b0CiMoIE1qfUZz1EiNcBiUkiLOtbKR4BfjSX1sFCWo0eCkI0YzyWRIKkx/Kd9BXyAcq1 QOw32P8GOzE2Y2eY0l/ZAE6ycYSCiECM1GZwPwh57Oohsq+bjK3R4R0m1UGvH7/3M48A +w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3shbc0tber-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Aug 2023 22:03:45 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 37HM3iEs011275 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Aug 2023 22:03:44 GMT Received: from [10.48.241.213] (10.49.16.6) 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.1118.36; Thu, 17 Aug 2023 15:03:43 -0700 Message-ID: <057ee7f7-ce60-45e9-9602-8046f78d8fb9@quicinc.com> Date: Thu, 17 Aug 2023 15:03:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6/7] wifi: cfg80211: Annotate struct cfg80211_scan_request with __counted_by Content-Language: en-US To: Kees Cook , Johannes Berg CC: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , , , Nathan Chancellor , Nick Desaulniers , Tom Rix , , , References: <20230817211114.never.208-kees@kernel.org> <20230817211531.4193219-6-keescook@chromium.org> From: Jeff Johnson In-Reply-To: <20230817211531.4193219-6-keescook@chromium.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) 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: LL15tA1U3um3hZWpW-MUj35JQzsq20Bp X-Proofpoint-GUID: LL15tA1U3um3hZWpW-MUj35JQzsq20Bp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-17_18,2023-08-17_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 mlxlogscore=902 clxscore=1015 priorityscore=1501 impostorscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308170196 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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-kernel@vger.kernel.org On 8/17/2023 2:15 PM, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct cfg80211_scan_request. > Additionally, since the element count member must be set before accessing > the annotated flexible array member, move its initialization earlier. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Johannes Berg > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: linux-wireless@vger.kernel.org > Cc: netdev@vger.kernel.org > Signed-off-by: Kees Cook Reviewed-by: Jeff Johnson