Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2524968rdb; Mon, 12 Feb 2024 07:38:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGyRY28lrIeyD0uMXYJJZT+QHDbaq9dybIJWxVsDA/EPArXVC8XMmddyQAvOHWtYPbjdsw X-Received: by 2002:a17:906:fb91:b0:a3c:8e78:8b59 with SMTP id lr17-20020a170906fb9100b00a3c8e788b59mr3097239ejb.15.1707752298918; Mon, 12 Feb 2024 07:38:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707752298; cv=pass; d=google.com; s=arc-20160816; b=jyuCPzJm+YlzhxqQ4+6sccok25uSYErrX/dOqqdU5NiQ0yrlY6/l7B8ipgAEiAAapo PR2nZCk7DTwrQC88EBX0SmFtuCB6mpn0qJVe6ovQnLulUBNId5LlU6cA4wuqTNGmOPW5 RtpBOx6Jl6yAsJzZ80uu+2F2/SGQWqCsu46nZM+Z8oNebU/gzR4k6PgkG7+b/tvxAYUB ZMdTjZJHAxokDqfpmMaNf0iK6ZSCW5Ceus/VQVt569V3lGeobcRJH5wCVrKbmDQ9p0HH s+b/eHNuBVueVJk2tBrJBzQ9rkFAEHkAyJs+kZgf1i0UTUNuO0xiddNK/teUJoQr3VrO LEWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=9Q47ApS+x/1EQcmcIQqi0qxWHG0/4bJCnXoA4lK8f3E=; fh=pEedaLsn6qTbxSfzrfBM8gUNnhSe90vV7dFetSlQHbc=; b=c4p97RFp4eIC1oDLxWqj1dLRq5LKEupEwXsuwyAVgSP3/HoJYOSWHUA2RTXpyhd1tm JqADrZ1IltoRmmQAcB8ou2JBRXFpLIPKJtgxpu5uh2voVdaSisYKqb4+nXh43iUc+HW4 fTg/UwTEdwy9Y6eoSSGwwC/TD5cb4x/SxOkf+/4nIUAxH4+QniMv9tGe33NuTWxutK85 NRkE4PDR1rnJjqt+YSRCyqv8EE4p2ifkm9VCpn9B3pdi/J6qHHOy2brIj6P/BMCPnRzF tnHdKNQJqZCAJdPb91o99W3JCwuvy98ebIH5rChcgGYo9OkBe+GFcpNLhqkW0XjzCDyk Q9ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNSCUkXo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXXezVxR3+5JUujtZwLQbMaoN7cdYWL3E9/DCDHIDIFX88qbrsWjTnXvIbzUWy0ebf7VFxI+lSIVrqfTa11kBSg0qH3nNP2yZGSJWoouA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g14-20020a1709061c8e00b00a3bfe76d6fesi298229ejh.113.2024.02.12.07.38.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 07:38:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNSCUkXo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3465-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3465-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5E8B91F21F2C for ; Mon, 12 Feb 2024 15:38:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E999C3C492; Mon, 12 Feb 2024 15:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bNSCUkXo" 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 BD91A3C088; Mon, 12 Feb 2024 15:38:12 +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=1707752292; cv=none; b=iMBgRq4Zkfr+3XxYvMvjj0jDkqfYlOHWmq9jOXX+fWiJDGzMakgJvHDgdF2rs51VXS6tVUXc56VSL4t/UeBkxdM17/9wUwMfXSd3Cl+vltIatOAk4ivirEYZl+QgLAW8AZi3D0o6zPvcU3MTmIgf4SvNkOKsBR6+NnNc75kgku8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707752292; c=relaxed/simple; bh=AKNvaHsgQo+M8zEEgaqhqkD3MZ727WnLytCZB7yGkVQ=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=Ig86C40GDyjAvqd2eon8FmsSz0R8gz4G24lyVwKos6xGEh5wKFmyCFcXOUEDA3/CR8v1M/ol+APBw4ylb9v3iZt9y1ZQEI5Do2lcgLzVT9WM/I/r3s5YAJO6xaP7SuXZmxIm/Zhh93wB2JViB23dYSjTz/r6IU0UpHHGQdt6nL0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bNSCUkXo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF16DC433C7; Mon, 12 Feb 2024 15:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707752292; bh=AKNvaHsgQo+M8zEEgaqhqkD3MZ727WnLytCZB7yGkVQ=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=bNSCUkXodN4XgX1J8GbQcTLI7YMVUSQpLbE1+hebO5I/ARJX1bL0dZd8B504gyt2s k/zQ6KS9V176qtdXBd/B4hG1yz8REsROm16E+2IMxtEOqcLy/SSOjzSS4eeTTkA/F1 l5CVw244A/3qoNPBxexMi5/chQqj6Xx8U97VM0hUctN2dybt8ZA/eXJ5qZ6524URyl anNkudA46LDlGiR1TJDHvns1Qtb5M93a2wuN1bXEMPBo37smf+fe7l2Q2GKHELmPEf T4/ZrjIMrovEBg/SFwvEJB3FnPWSVPzzDmxy6XsQ2rta0EvBEWdFeomlX+uv7Caq0/ Nb0kC5/Z2i/Eg== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v3] wifi: mwifiex: Refactor 1-element array into flexible array in struct mwifiex_ie_types_chan_list_param_set From: Kalle Valo In-Reply-To: <20240207103024.make.423-kees@kernel.org> References: <20240207103024.make.423-kees@kernel.org> To: Kees Cook Cc: Brian Norris , Kees Cook , Dmitry Antipov , Johannes Berg , zuoqilin , Ruan Jinjie , Thomas Gleixner , Christophe JAILLET , "Gustavo A . R . Silva" , linux-wireless@vger.kernel.org, Dan Carpenter , Francesco Dolcini , David Lin , Lukas Wunner , Simon Horman , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170775228681.2851594.6070070242483330161.kvalo@kernel.org> Date: Mon, 12 Feb 2024 15:38:08 +0000 (UTC) Kees Cook wrote: > struct mwifiex_ie_types_chan_list_param_set::chan_scan_param is treated > as a flexible array, so convert it into one so that it doesn't trip > the array bounds sanitizer[1]. Only a few places were using sizeof() > on the whole struct, so adjust those to follow the calculation pattern > to avoid including the trailing single element. > > Examining binary output differences doesn't appear to show any literal > size values changing, though it is obfuscated a bit by the compiler > adjusting register usage and stack spill slots, etc. > > Link: https://github.com/KSPP/linux/issues/51 [1] > Cc: Brian Norris > Cc: Kalle Valo > Cc: Dmitry Antipov > Cc: Johannes Berg > Cc: zuoqilin > Cc: Ruan Jinjie > Cc: Thomas Gleixner > Cc: Christophe JAILLET > Cc: Gustavo A. R. Silva > Cc: linux-wireless@vger.kernel.org > Signed-off-by: Kees Cook > Reviewed-by: Gustavo A. R. Silva Patch applied to wireless-next.git, thanks. 14ddc470ba22 wifi: mwifiex: Refactor 1-element array into flexible array in struct mwifiex_ie_types_chan_list_param_set -- https://patchwork.kernel.org/project/linux-wireless/patch/20240207103024.make.423-kees@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches