From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EA60CE79CD for ; Wed, 20 Sep 2023 11:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234443AbjITLPX (ORCPT ); Wed, 20 Sep 2023 07:15:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232848AbjITLPW (ORCPT ); Wed, 20 Sep 2023 07:15:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FE66B4; Wed, 20 Sep 2023 04:15:16 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AC11C433C7; Wed, 20 Sep 2023 11:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695208516; bh=ien7KJ6XrEwO+Bq1GOg+pQVFCdR0bSGZcnV8VgcfewU=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=CsrbLcn0B04q8yzKIGWnAmLze/wJn2L3uZ5janCCQPzqPJVzIZMj0qrIRzfMwsaH4 VDt3AhmEL7/0BjRbm5ksl5MC5S4n1OjDWwtfm3LlqIQcEzk/KckODpRWoOZtugs2J6 Ci3S8owHmJp8Ka0ju5sHhJbidqzjPy3HPnzKL1bssN9xLyHgLROH8S8VdQAvcamCk9 YyeIj88LjkjeiTJTsGSwU+uosSamxtbz2EqN7/ZFrMpxCkeeYRZiG/dCId8/dkb0ng TNHW+7duY3URUS74lLEmB3lsIs27y+w6dZY7CCQq7aIfmmHV2YQMjnTp1U9bNCKM7f TatzLJmdWmlwQ== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] wifi: brcmfmac: firmware: Annotate struct brcmf_fw_request with __counted_by From: Kalle Valo In-Reply-To: <20230915200552.never.642-kees@kernel.org> References: <20230915200552.never.642-kees@kernel.org> To: Kees Cook Cc: Arend van Spriel , Kees Cook , Franky Lin , Hante Meuleman , Matthias Brugger , Hector Martin , =?utf-8?q?Alvin_=C5=A0ipraga?= , 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 , "Russell King (Oracle)" , 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: <169520851058.991705.15337054707712499896.kvalo@kernel.org> Date: Wed, 20 Sep 2023 11:15:12 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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_fw_request. > > [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: Matthias Brugger > Cc: Hector Martin > Cc: "Alvin Šipraga" > 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 > Reviewed-by: Matthias Brugger Patch applied to wireless-next.git, thanks. 45aec443bbb0 wifi: brcmfmac: firmware: Annotate struct brcmf_fw_request with __counted_by -- https://patchwork.kernel.org/project/linux-wireless/patch/20230915200552.never.642-kees@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches