Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2290169rdb; Thu, 21 Sep 2023 14:15:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+yddc8wyZ7LXSJvEA7ONExIcV1l0Rfjq2nDTQf7q4eY/Ph67BPDJKwBuev0UlZQv8khF3 X-Received: by 2002:a05:6a20:144b:b0:15d:9d8e:ad8b with SMTP id a11-20020a056a20144b00b0015d9d8ead8bmr960321pzi.32.1695330918994; Thu, 21 Sep 2023 14:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695330918; cv=none; d=google.com; s=arc-20160816; b=QXRDXE8716IwVYF3g8IGFu1iaoW+L1w10h3Gwh5IgDDgU8aT5xlOdsFkQsVzrK+MMT VBmPWSkn+Sh+hz3wTCnrxcDeZR76CJmiNMoXokATCammADT5CoiiH9xvP7eloKeyMUxU 1ZG0QOo8ngUzMINfM47nEeG9EB7WZOZv6ZdV8sdb8dA1iohC3WfKQmwZ7dK/G+i5GLgo W0ifNyo26uzNtS+rfSbgeLBn01Qnba7+K+w1VNfiwthBnmp3rGsAQYmq65c3UtlaChF4 EjizEgbzrFoO8ZgHUPEI3FLzaHlmDwt4EMl7yiTzqA5IzX59Mpy6e287puhLhpPtAlAF dNnw== 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=VjFCnE0DAEptGB0YbZJ7HMAiRZvPtbNVBbcu5u7w+cc=; fh=b5Uh5K8ProMJy5VM3ihcjOo8S5NGd9wAw80C/dLGaiY=; b=uIoLpB1aq/X9VrtADA4tOSqxjitCNtbsfovBjfqCyIvwr2m0n3SePqVoGXVssvHjZi ZboFMUxhezqNuKDYylc4JqdcrKH1GY9eWJagMa6PmXE+jqBLft3nsvY6wDm2PcSqGGx/ Zk3ck+gsJWQ76d7WWkpIwausowvgIdBytmipPUT41F0Uy3D21t2ZFq4E4cO+3lv3YO/V P/22oT8txDbmkIr6YlV0t8Taw6uRjxt06pGGDzotPfHzloowawvgPohKeA0siOKH32Vc y/zQq6y8ROSGsfODj0Kn+/no59rB/MUbd7yJ5M+9W0COAe1XzN8NwZhTfL0evh589pEO jgJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U6NPZ+8W; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id o9-20020a17090ab88900b002465d98f18csi4344834pjr.170.2023.09.21.14.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 14:15:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U6NPZ+8W; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id D22F18374D8A; Thu, 21 Sep 2023 14:06:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbjIUVFn (ORCPT + 56 others); Thu, 21 Sep 2023 17:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232597AbjIUVEk (ORCPT ); Thu, 21 Sep 2023 17:04:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C14527B957; Thu, 21 Sep 2023 10:37:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 288E2C116AF; Thu, 21 Sep 2023 08:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695283781; bh=CRChqGGo4RR2euNwhsDyCD/AoeyKktzzjOKjh37j308=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=U6NPZ+8WyNsZOrY2Ac+ioT6/gPDw2ATD5O9tV01TxCmDZ6+hXu1KPDEIz3a3Gtwqx tKsvCJSSNEHimX8QPbVZQJ4UTZG4trO9kwulY4CGG1iwMP3qdSH0L3z5X/N9NfDFTs 2lCfQEvwcgBc8JcV3rpcBvh779jTDhW9ZYVktRfLINCxVbeWSUqjqeqr1H7Y3KaCi9 5FHGysRq9RRBkxkT+7NXxvkZBnHbVe7pX4kVgVqaQ4ADoRTodYgJTD/8oPWCJZVggu hFQIs+fghTAVHf54bge5tZrM34SrNJyWsXFComQWwYojGcRYn9khtN5vaM4m88eMX0 /wYF0Fl26L6Og== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wifi: wcn36xx: Annotate struct wcn36xx_hal_ind_msg with __counted_by From: Kalle Valo In-Reply-To: <20230915200622.never.820-kees@kernel.org> References: <20230915200622.never.820-kees@kernel.org> To: Kees Cook Cc: Loic Poulain , Kees Cook , wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , 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: <169528377712.1539628.6973937251769266180.kvalo@kernel.org> Date: Thu, 21 Sep 2023 08:09:38 +0000 (UTC) X-Spam-Status: No, score=-0.1 required=5.0 tests=DATE_IN_PAST_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:06:03 -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 wcn36xx_hal_ind_msg. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Loic Poulain > Cc: Kalle Valo > Cc: wcn36xx@lists.infradead.org > Cc: linux-wireless@vger.kernel.org > Signed-off-by: Kees Cook > Reviewed-by: Gustavo A. R. Silva > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. f8cbbb224b11 wifi: wcn36xx: Annotate struct wcn36xx_hal_ind_msg with __counted_by -- https://patchwork.kernel.org/project/linux-wireless/patch/20230915200622.never.820-kees@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches