Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp160422rdb; Mon, 18 Sep 2023 11:00:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGhdOoJbZg9VLPTViNX0eYDwx0R6n3rFgBT2XtLlhRM1Nl1W+0djTD26D0/oMb5bqlCGar X-Received: by 2002:a17:90b:3688:b0:26f:6f2a:a11 with SMTP id mj8-20020a17090b368800b0026f6f2a0a11mr406240pjb.12.1695060005763; Mon, 18 Sep 2023 11:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695060005; cv=none; d=google.com; s=arc-20160816; b=TfmVPtqT5a6RTzcTm3ELNNPKRsSekm686NDyYSMa5OEchUmkO0wZ98ghJK+lYw/Uj4 e6MC/5KhJvcr+R+KIQVC7mTIXNGxiIR+/TT2IDjc/yFyKBZa0As7BxZbPmKQiiyMDGcX wH1uNyT8LVJC/+ZL/DKBBHzGf/ruSpSgqf0tsCs4+cOh3PfvMQx+BJj5WP9ZvsvI9p3W RUXvq/9QuDdCtnz8P987XV9PYIc+vTI+5YJ3DMg6VtyVDB1mGIXFXllXBQ2pN+B7XY89 diul5MbWfYZnoWwmy+HVx1bCz3LN0ZSt5b6kuZwKXiY6nhSpsnljVatiYCcSyG70lPBf G0XQ== 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=UGTjC99ZbMhqXcB4Su/RqcAXua92fzOLIZuXnZdiSyQ=; fh=FPWytYzDl+Cd9PrmzdpR5iV+G56cctB5s87xTl+v/vY=; b=jKTvadcLp9WsI8/dSmZOQxyYNlWCNSXiIU83fgreBKOddS+oLr29UVkDAYlz4enZke yOsAYHsgV40E2KLxF9nJmXwK56INjmtgE7jn7fDh/1LdX189gvxqLL2lljoSNqlSE6vb pkkt/u/8ODQrUHj7T6nRyoRADHMLnM3AAEWEC54nK8VCUvf+yyaLpVyJOWD9W2OyaQUe 0vsfy1hamdwz2W+/8ep5yj7jq4iU7cLUVobnOMuvNq3X6cghabvGANfRVlPzwS1yFKVC BCTY1ZBDsGPxJc8x77gDA9gRX5MfCR/uQ/v4Nhyj+TRGSHwON2rCYTYX50QY8roJJ8hq +g3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bJ7yDdHK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-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. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ck16-20020a17090afe1000b00274d3f62044si3771928pjb.111.2023.09.18.11.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 11:00:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bJ7yDdHK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-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 1100C811EDA3; Mon, 18 Sep 2023 10:03:03 -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 S231396AbjIRRCo (ORCPT + 99 others); Mon, 18 Sep 2023 13:02:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbjIRRCi (ORCPT ); Mon, 18 Sep 2023 13:02:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EBFE93; Mon, 18 Sep 2023 10:02:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D542C43391; Mon, 18 Sep 2023 13:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695043234; bh=ij64horHxqCr6tNsHUKw9q182XiZPq+6TuHedYlAa8A=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=bJ7yDdHKoHkvsLxRuIHaF8svocpAFG573VOvgpGy2veP6jiXsKZrk6j8En2Agh4Wb 3FcoC9RO7PUyVPvlKlgmbMho9gEGeW+2tZUaj7Wl5Uk7SKbyaFSDSxjDApZvDRY/O8 Ctg/DyPa54XDpujgjx1ff/ccB/x69Qn5RCM6R4+ij9qqbkUlPYPHD11xb+zMwQ+daL YMpG9u2AtWV7Ks3X95Pr4MAnQOrH6gI96LOnzRC58RZBrhm+tlaGOd2ysygxd8qE88 BjFdEK9G9xNHZOoJ7jtu+6+6wc5CubsvBdYzsKNaWrFgEs+0g35TgJe+jPSFGfls4N IM4UHjRe1trHQ== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v2] wifi: brcmfmac: Replace 1-element arrays with flexible arrays From: Kalle Valo In-Reply-To: <20230914070227.12028-1-juerg.haefliger@canonical.com> References: <20230914070227.12028-1-juerg.haefliger@canonical.com> To: Juerg Haefliger Cc: juerg.haefliger@canonical.com, SHA-cyfmac-dev-list@infineon.com, aspriel@gmail.com, brcm80211-dev-list.pdl@broadcom.com, franky.lin@broadcom.com, gustavoars@kernel.org, hante.meuleman@broadcom.com, hdegoede@redhat.com, keescook@chromium.org, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, marcan@marcan.st, ryohei.kondo@cypress.com, stable@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <169504322899.617522.3173548821985178100.kvalo@kernel.org> Date: Mon, 18 Sep 2023 13:20:30 +0000 (UTC) X-Spam-Status: No, score=-0.1 required=5.0 tests=DATE_IN_PAST_03_06, 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 18 Sep 2023 10:03:03 -0700 (PDT) Juerg Haefliger wrote: > Since commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC"), > UBSAN_BOUNDS no longer pretends 1-element arrays are unbounded. Walking > 'element' and 'channel_list' will trigger warnings, so make them proper > flexible arrays. > > False positive warnings were: > > UBSAN: array-index-out-of-bounds in drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:6984:20 > index 1 is out of range for type '__le32 [1]' > > UBSAN: array-index-out-of-bounds in drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1126:27 > index 1 is out of range for type '__le16 [1]' > > for these lines of code: > > 6884 ch.chspec = (u16)le32_to_cpu(list->element[i]); > > 1126 params_le->channel_list[i] = cpu_to_le16(chanspec); > > Cc: stable@vger.kernel.org # 6.5+ > Signed-off-by: Juerg Haefliger > Reviewed-by: Kees Cook > Reviewed-by: Gustavo A. R. Silva Patch applied to wireless.git, thanks. 4fed494abcd4 wifi: brcmfmac: Replace 1-element arrays with flexible arrays -- https://patchwork.kernel.org/project/linux-wireless/patch/20230914070227.12028-1-juerg.haefliger@canonical.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches