Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp251969lqo; Wed, 27 Mar 2024 11:58:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXB5OIVNbKW7GVZGO+4QKDOvui/Q0V7CjeVUnIBxputqaPm5EOiLfuzSzgpFsRcSq1DOWLeIntN7FldOZBqNuzSYc0vjcNiszFeGduOXQ== X-Google-Smtp-Source: AGHT+IFOJsNXBwG6H7XR7hnNKILXfxDl93SGkC1xfXKVwQMV9jVZZpZt9Kmg4GVu7A9Xm1QIkgii X-Received: by 2002:a05:620a:1a2a:b0:789:d443:96c8 with SMTP id bk42-20020a05620a1a2a00b00789d44396c8mr595494qkb.47.1711565882060; Wed, 27 Mar 2024 11:58:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711565882; cv=pass; d=google.com; s=arc-20160816; b=Vu2VIupJ5ZpD3JRJ5f8lsSEQNiN+BbWkY0TPefCXQ6UOuZIfqV85NLaQXu8vxZga2A QoT1Z7f++O0RBNs0ev5r5hniPcPRcwXctWk6LFp0r6LH/ySsLVWKmOxG0IlNFRGhCg5Q qQfrQogZTZP3nqsOskPSkJJGAcIB6/+r76ZUenhEKU/89jElWJmBKSXOTxw91Itj/q2k tgkuvRZCLLsvrtg8q/8AvvId4XnOQS4mNGbMuE081CTMDsbbq9w3AMpNKfOe0tzo1b7G nZH19cYmzdACmuDYVDtappkrhaAmFX97lXv/ZuHyAp25oguKgdrorJuzE8iTLvltOxfR 8ZaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=Y+XQNOQYBTJAk1rQVcXBJponPmthZCxvyYzgQO/JZ9A=; fh=Tc6pwkjlwkXr71exz6EN5g7NqOXnmMeodmzKq+00dzU=; b=gfghsKxhVY32Ad+F4XWRFR1eVXvVdvRAdjABuslSGzKjKU15Va2Y7cTwxbRVEBarIF OZb/EJXbk+48d0EdXRttPX65iy09C8hko/SMisziTrBjyWQ/eTqmAfJcz6nUNxondkBG 09CWQo6G/lDgMjIqp0LLVTis0HybEcFpP44mMo7eeUpaHPuLVzS2WhmzLnjVX4pG6zs6 zShD5eUHSqoKklhRdwUcO5fM8I6GRvC0yZMu8nvk1WALGwrckZdfSDMAERiE/0b+mca/ jC+FyT40w0Fy0lyUW2Ir9odZmi1NuUu529/aYi5Rvxag7d0LhpPZZ34qSlmSUMmxVQjV 17gA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tF3JRb8K; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-5398-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5398-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wg26-20020a05620a569a00b00789e95512edsi10217621qkn.320.2024.03.27.11.58.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 11:58:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5398-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tF3JRb8K; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-5398-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5398-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1B7561C34553 for ; Wed, 27 Mar 2024 18:57:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C6FD1514D5; Wed, 27 Mar 2024 18:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tF3JRb8K" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 015511509BC; Wed, 27 Mar 2024 18:57:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711565868; cv=none; b=sOt25esHaIKMUiWs8EhVUK9PC9Jh9BERkdIvR4NUIBBEViUJo5Y1N1VcSfr73GuAONg0lEGFKIDv9Ky85HzJyqN7gs5TB8Ey1kg9vAbxY337EE+9nDJfTobsUlE+9gbBspAxwsDkLvi7dYQWxG/+nwzr9tRfZIBQCN6aeFadi/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711565868; c=relaxed/simple; bh=EC6Lhxkjvx1RpPe8rDFDyBQQQkJxJTIgY5bGiM+h7Xw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=taolIKfuO8g8we1k/8V6b4S9D9NOVivL49Nj6N1bWrS+6AoCBPi8Vsr5mlwV3CZ6u93ODYz0CIxO4pmKtvjSlS5Gjt1UprESaEohAnbtNfZY2qbM6+IPai6XnpHvKL+Ad6/tdqvKjKV/ovh0Kj3H64eEBWLJrruI2vL7u+yg9+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tF3JRb8K; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AB5CC43390; Wed, 27 Mar 2024 18:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711565867; bh=EC6Lhxkjvx1RpPe8rDFDyBQQQkJxJTIgY5bGiM+h7Xw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=tF3JRb8K0zVTMpTpEUINfK+CRCiKDrrRZ5kQLkb0BVenivWSPFCRLdve5w+h+93Xi iJw147g4OWCBX4pTW+AmkcfeD55W5Aj4V0HHjt+6YScU5f3z2bVyhoPS+NXr4E1D0b tc1Vpgiok1EwSVNyiioQnJyL5xxC6WrfpCMYmdAe8i6nSQhqqAUbW4GKJOtpH8ETYH z5K/yMe5sV7UERNL6DRbl9gO0SsgkBbzcepH9gABgkx4C4u0IMQ8TWZPuQNXiDpuZv HkSyX/5+9hkz5vFoYB9/Gwm59PlzoW5RXEIhX9VR/cS+yGr+W1mtH5mTRmDflGq8O0 2yDSlN55MBqjw== From: Kalle Valo To: "Gustavo A. R. Silva" Cc: Jeff Johnson , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] wifi: cfg80211: Use __counted_by() in struct wmi_start_scan_cmd and avoid -Wfamnae warning References: Date: Wed, 27 Mar 2024 20:57:44 +0200 In-Reply-To: (Gustavo A. R. Silva's message of "Wed, 27 Mar 2024 12:50:52 -0600") Message-ID: <87edbv7b9z.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Gustavo A. R. Silva" writes: > 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 > via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE > (for strcpy/memcpy-family functions). > > Also, -Wflex-array-member-not-at-end is coming in GCC-14, and we are > getting ready to enable it globally. > > So, use the `DEFINE_FLEX()` helper for an on-stack definition of > a flexible structure where the size of the flexible-array member > is known at compile-time, and refactor the rest of the code, > accordingly. > > So, with these changes, fix the following warning: > drivers/net/wireless/ath/wil6210/cfg80211.c:896:43: warning: structure > containing a flexible array member is not at the end of another > structure [-Wflex-array-member-not-at-end] > > Link: https://github.com/KSPP/linux/issues/202 > Signed-off-by: Gustavo A. R. Silva > --- > drivers/net/wireless/ath/wil6210/cfg80211.c | 22 ++++++++++----------- > drivers/net/wireless/ath/wil6210/wmi.h | 2 +- > 2 files changed, 11 insertions(+), 13 deletions(-) The subject should being with "wifi: wil6210:", I can fix that. (Didn't review the rest yet.) -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches