Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1257656rdb; Wed, 20 Sep 2023 04:27:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDPPCWcVHyYG5LhlioSL8BKoL2dJgu18VMJ1Epm4/fYaatN/g5vjljGon8TXzW0kbbtD4B X-Received: by 2002:a05:6a00:1d87:b0:68f:c2f7:cef0 with SMTP id z7-20020a056a001d8700b0068fc2f7cef0mr6803584pfw.4.1695209221554; Wed, 20 Sep 2023 04:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695209221; cv=none; d=google.com; s=arc-20160816; b=JYSX9h9yaIN+uahl4+yCB38uald8TanXmP0PKSQMCvL5m41OnoDVRuYXyvPKpx/tbf g+lATbMnLt3sPWD6iKE0wnCSkwIe2a1VlsALUNiIX/2+N7hV4UgcRyqOPtbFf3UUfET4 qleR/TMHCS48Zui+4hiNNQ3F1PUaXXo/bvB3hBR9Py8gAG/ENb/LUlCDPhLoqXG3vRg4 61viDC+PxiGDJUHEq2mqan1+FbbocGbZZUIstKAE+lE0fMuvSxpQ2g452ivr7ndSBf+6 MEVo9RDcmOh9gkelN8ttt4JKMMvwuk/TSEFZRmQG5iRsVErr7pMINdo88lrBl5dEM8Lo Q5Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=6xBQIJUtWnqTWICuTV6BnxkJBYl/EdHuFFE8z7z1efM=; fh=SmptVNwNB8vaRfRUJC6oyfKeuhGkAQtgNrNZVnErMr0=; b=oYmd+2lgACNvJAe3B6uTOK/aYw9Sojpo8FLp5oGBQX9/Dh5rMVxrqHMng468AWxjpq r0LJb2NRghYQa8fBRF71CFPRXP+JDmRHvTilhwvDEQYOqNKjLqgSlcBRZBTqfE6ObADt 2PaKnXIVTavbVyGSze1YB0sPtAU40jyol4N2zFWiNmG8AQ5sZTk/r5VOVZ8NJohMM4cW XK+fC1xHZUsTREl4TJw/HxXVIGkn+MFGb+MnRPILAQOoIKrTCIHeU60ESODVEvPyZdUF mHiGisPVg3pbnDJJ9y54UQzYd/+z+vqjXUGgm8w9oMNQwWsubTTr+NbumOx79OIk7IDO NY8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ijaRBULS; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m11-20020a056a00080b00b0068740bcd8d7si11828528pfk.362.2023.09.20.04.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 04:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ijaRBULS; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F18918194754; Wed, 20 Sep 2023 04:14:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234343AbjITLOf (ORCPT + 56 others); Wed, 20 Sep 2023 07:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233970AbjITLOe (ORCPT ); Wed, 20 Sep 2023 07:14:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8CB7B4; Wed, 20 Sep 2023 04:14:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B11D0C433C8; Wed, 20 Sep 2023 11:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695208468; bh=4ohIM+PR0LkQKum0byuzz3ycyYgyXeMylliHgM3EBoQ=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=ijaRBULS666AbH3P/pJ1eLSNRJVlcFLP2EhIlkqKmf67PK3VEk0FGPCGvEuEQDmS7 j1aCPJ66Nitqle4/qWtja+jVqxH2qBTrvVvTWPAMlK74IvnTkUNAzuSIhvdakto8VV 7NNJCtv0QZLkosnal/BdrOVmbQAIvb2TGVVOUd3E6oZbxU8+oSwwktwz/Io2brXEQE e1vd39tAiQkcBu2zMneGhhamjGIlwU57BCfvYreadbW3zg6RkfMXtR5oQSzsh/ikRx bLfGnluPZKjQ2kpMKSOdr4HuUgpvLexkddvsXwOf5eIQsaHg4WOa2UXIUHSAdebaxJ IojSj22oBbFBw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wifi: brcmfmac: Annotate struct brcmf_gscan_config with __counted_by From: Kalle Valo In-Reply-To: <20230915200542.never.417-kees@kernel.org> References: <20230915200542.never.417-kees@kernel.org> To: Kees Cook Cc: Arend van Spriel , Kees Cook , Franky Lin , Hante Meuleman , "Gustavo A. R. Silva" , Hector Martin , Ryohei Kondo , Hans de Goede , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, Nathan Chancellor , Nick Desaulniers , Tom Rix , Linus Walleij , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <169520846255.991705.4120611293307630241.kvalo@kernel.org> Date: Wed, 20 Sep 2023 11:14:24 +0000 (UTC) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 20 Sep 2023 04:14:34 -0700 (PDT) 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 brcmf_gscan_config. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Arend van Spriel > Cc: Franky Lin > Cc: Hante Meuleman > Cc: Kalle Valo > Cc: "Gustavo A. R. Silva" > Cc: Hector Martin > Cc: Ryohei Kondo > Cc: Hans de Goede > Cc: linux-wireless@vger.kernel.org > Cc: brcm80211-dev-list.pdl@broadcom.com > Cc: SHA-cyfmac-dev-list@infineon.com > Signed-off-by: Kees Cook > Reviewed-by: Gustavo A. R. Silva Patch applied to wireless-next.git, thanks. cf74cdc6e581 wifi: brcmfmac: Annotate struct brcmf_gscan_config with __counted_by -- https://patchwork.kernel.org/project/linux-wireless/patch/20230915200542.never.417-kees@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches