Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1265267rdb; Wed, 20 Sep 2023 04:41:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFk6hHBz3Wi0ma/5Y64cnH5le3uDjhRDmfva4aWE6Sjy6OP8APWOgV5myo1qXZhkd0pd8wu X-Received: by 2002:a17:903:1205:b0:1c4:638:fff4 with SMTP id l5-20020a170903120500b001c40638fff4mr2107902plh.17.1695210087417; Wed, 20 Sep 2023 04:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695210087; cv=none; d=google.com; s=arc-20160816; b=PbLJ7JAaTuQOpc6B57C6C4RaqV2BgUCv85gMeOWw9Ln0YDauTKwqnMnSu4DVi8PDLm XfEsNxKUBKEeZuUDOB4qH5MtwbH5bQ8vXaN7ZeysSwFq65m7LZ/xPSyLWpf1kZ4Yy2/F CqgluoEwzxbCSZvpwL1XJ/rI1mfQLlWGm/C18GVkIvGwr4EsPfHYeZMnTgh3pW46lG8j 7yOkSo+KJhunCiyRuLbdlo2HbEo5r2E0BqoDYVmkylylj4RdXnRFCOOK/jL00vydZnoU /0vgCwjO6J97qUW0B5l4rS5DE52+IRGJJb9sPw9b0afWnXtkQua1HrDWgEgjudbSqQQe vLqw== 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=ACVtDr0VvIiDM5Z0XI3YIu3JiBKGxk3J+J0eEaz5Je8=; fh=70ZZp7FVeRxmvpOtcluGabLzwZJcpYx336mrPDS7l5U=; b=Iin98fl7i8KmgKEYbstfta5uqsr25sp8Pl+5R7PLsRALd3Z11pXw9IGdCGefxMFLpT BZIppGuocFn4s0IBIWF7Xwk2EGe1htGPG4/9STT4fEHCetL2S9V/x0xgYVV/Th7vVOKq MNmw5CmslgR4RjHVYANpc49IsfIqiU2bBRuBEoB1bKMzrLsQV4CkW+Yt+/diuidUJtJT p7fY7VArmE6k6Ds+AHrf7UwG2WovG7psW4mLyZ4eP+VJ9L4eJ1ebBx8siVKqA8JOkMSl hE/Nl4qire2gmvoz6LbgGe3eEBhBX2SnaHrrFt0HT9hShXivEXiN6V/QgAph9QePCr9r QytA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CsrbLcn0; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i17-20020a170902e49100b001c3a2e70278si11563880ple.437.2023.09.20.04.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 04:41:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CsrbLcn0; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id DF0EC8074507; Wed, 20 Sep 2023 04:15:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234443AbjITLPX (ORCPT + 56 others); 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) 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 (howler.vger.email [0.0.0.0]); Wed, 20 Sep 2023 04:15:23 -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_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