Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp766784rdb; Fri, 6 Oct 2023 20:43:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMQ3qYZhPalCBEjl8nr0jiU/GiOGZtHCX8DhD57My8pLNM2xxuJlUHyUa4abCWc7Rc1pbk X-Received: by 2002:a17:902:d48f:b0:1c3:7628:fcb3 with SMTP id c15-20020a170902d48f00b001c37628fcb3mr10733880plg.47.1696650225400; Fri, 06 Oct 2023 20:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696650225; cv=none; d=google.com; s=arc-20160816; b=qJdhKxgzin2lcRpJ4FxQrxUNl+RwME6YAwqfSguaPUoazwFKoWsX+lnM7pF3e5xfhi Z4N+rJAgusXUBCseylPJF6Y4dY+y4gUOAjni5077e4id25nWcinf70ssAJKulubMd0B6 0yTqcDh4kqiL1aDt3kL9MaERsRLzVE3WRqybFuNWCIms0XnkPg17H0RnMERoPhra922Z EjBZ3OFRSGiY5uRlsi2I5Xq4jKZkJQClIhkHx4H0xHTDZJsQ7EZNHRCDEJ0/5Ryafei5 S9XhwpxQK1cwhsscygoFrZS0FrTWfjCcu1tb7BFakF3gEcX7glJM3LdppgROA7xfUQAN MvNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=ch7HYFsdsPWB0qoPHYsF+QHzdHk/2DhiF+E3F5mbEBM=; fh=Tyyr92v1PlZoFZ3SU6VSx30frkqqiacqRWF1A8eGKzk=; b=OgAYuREutY8hiVpdZjdjzsASAt3Z6ZlrPkYhV7+rOkJlHIKlH5+KzdKCU5ZeHBFlD8 EcPjJ/f4DDL8I6KVID74/XCkb8hsf0hpQc+cUVHC7Z0jndQ+7HRvej2Ipsb5Ryxh8Lvz TDmHF2QvwXUeyxRppe/vFDCmaljERURdurFq0Eq1XrFqsBlYVBnX+Flt6SdP8Unr4VNQ +z4K9Uhwo76dEII0DPV5pUutbGvXX8XH6kTPcfmXduiz8Eg0fFdUdPbqiAWJ98nNh1Cv lO27aY0ql9ywm3tfjsavgz48Far5EIuLjIgAXUpX+sPa7zW9u8Scb3L6pdFqHG2F5mFU SiOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nai38z5t; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kc4-20020a17090333c400b001c77674ea97si4756862plb.423.2023.10.06.20.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 20:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nai38z5t; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 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 A2D5D8356441; Fri, 6 Oct 2023 20:43:38 -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 S1343516AbjJGDng (ORCPT + 52 others); Fri, 6 Oct 2023 23:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343491AbjJGDne (ORCPT ); Fri, 6 Oct 2023 23:43:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9140BD; Fri, 6 Oct 2023 20:43:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F1D1C433C8; Sat, 7 Oct 2023 03:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696650213; bh=/XnJFcvVU6ZpIin+GOGN2gLHcNQTV4L7LTIlpf+1yQY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=nai38z5tQi/p+Yb92wCONFYch2eSpqfHrzRMrnJ7iVeumcdV887o0orT0t+lcNxbD i40XIhm1BvRGR2ZMm9DH7dxV++olEpvAkXVd2E4mYUe8BtD/3KIZunE3wZ200+FA4e BVzRxvSlnUrshY2lDc56P5Hdequv+9GOndP7+nYDi1H3p7tMgPUekIdu2PwlCkjMAH KJ956YKUgrVkzSVW8EgLKj7UAnqXalGPoLumnXY8f5ot1+bmNpwT0pPydbsN+uByu4 U3sdDb8y3JeAf6SLYC8az7syBFG43FhZ4FKz8XJST4Ym/fAmRDep1oEenb1kvF2zue xGX8o2/Ru1yfg== From: Kalle Valo To: Kees Cook Cc: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , linux-wireless@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org Subject: Re: [PATCH] wifi: mt76: Annotate struct mt76_rx_tid with __counted_by References: <20230915200612.never.786-kees@kernel.org> <202310061320.8630F7E51@keescook> Date: Sat, 07 Oct 2023 06:45:52 +0300 In-Reply-To: <202310061320.8630F7E51@keescook> (Kees Cook's message of "Fri, 6 Oct 2023 13:21:13 -0700") Message-ID: <87cyxrgknj.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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]); Fri, 06 Oct 2023 20:43:38 -0700 (PDT) Kees Cook writes: > On Fri, Sep 15, 2023 at 01:06:12PM -0700, 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 mt76_rx_tid. > > Friendly ping. Can this get picked up by the wifi tree, or should it go > via something else? It's already in mt76 pull request and should be in wireless-next next week: https://patchwork.kernel.org/project/linux-wireless/patch/a5a2baaa-0db4-403e-9ebd-a7ff089675b4@nbd.name/ -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches