Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3515188rdb; Wed, 13 Sep 2023 14:40:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IET33zb8o/s5qXDoehwfXmlinyf19S39lOdOVjnH/4hBIq4jOl1+CwAAOyWyvGXzZM5lcn/ X-Received: by 2002:a05:6a20:565b:b0:14d:6309:fc94 with SMTP id is27-20020a056a20565b00b0014d6309fc94mr3138791pzc.36.1694641245176; Wed, 13 Sep 2023 14:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694641245; cv=none; d=google.com; s=arc-20160816; b=jHAAMnjrpXfGQDYM3RljzJLp4W9cKCUAAiE6OkT4CDGrCewg1Fti/sXf3Jck7xzC/i T0H7geLRWfyOB1+uhdIVwZUpDqOdWbbDb5kKCpBqGfFUwg596BYLiZOZu+cR64RSDuUO kGdyAvsI6tAoeholIFn4sJU/Fsdgz/VlIrFIIu6Cb2cdubM/0eej714pEAb4VIxEiijW TZ4ANTpapJtiOPBj4x7F6QRdXg85ghE5+vXNVlCCb5xwZ7glShjWfVQyQ2g76i2cl6YT 2Fph9bW+6VLErrNfMUcWI2ZG9yiUpIBHKbYfR6SzrPrRxrP8nrweHb+i+AcXa/CIJXeW UL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=n+MFrQb049CZGpD5Zjrkdb/5Mi4AniQ9UI6VaAP+DKI=; fh=qejvkXHlJ/Mvbzapvs5Rlmg9dpE2yfCfrY6nbN9uAhU=; b=J8gfZTFYiLfqECYImr8924DPMGjd16qBxeoQNjCvhO0UxQQoX5Vmqab4Lxr/Ova/EJ So293M1KFLwwi/it+jJKqJyjb/eywNwMJFLvUTdsQBaR9Pqyx5/ygGUPFCQi6YXXftKF /GnFBZJ5V0sG5gFXQyhhwc32DwYTqsC5iispbELLBN9fYZyVPtEmLMIovfjO8p7nl3c+ fa0omJFufK4PJ15nvtoddoKblEm4Kc2YdBgYh1MGEXRMptRmsA889aQLzRn9aB+7eYu4 wFYhMgIuXLWOmNwX5wV/g7oZxm7pfJ7UTrnQINfyBh2M9XXZ5xW8qJJ7l4trRCi6KSTu 1hHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nqobbugR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id kh11-20020a170903064b00b001c07bac13d0si154656plb.383.2023.09.13.14.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 14:40:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nqobbugR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CBBC3826E383; Wed, 13 Sep 2023 02:29:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234921AbjIMJ3R (ORCPT + 99 others); Wed, 13 Sep 2023 05:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbjIMJ3Q (ORCPT ); Wed, 13 Sep 2023 05:29:16 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2440EDD for ; Wed, 13 Sep 2023 02:29:12 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id 3f1490d57ef6-d7b79a4899bso5777141276.2 for ; Wed, 13 Sep 2023 02:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694597351; x=1695202151; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=n+MFrQb049CZGpD5Zjrkdb/5Mi4AniQ9UI6VaAP+DKI=; b=nqobbugR0J71jJav4XvddP5C8S7awiekldJ/jzjRx4AKyl50wOWNzjflUI14AUFAIO NM36yEiaa1NpqZ+DcgBUF0JAjxW/OPyeSs6YtcchwUXDg7en7kZhoJIEqE9JhA4+yEwY ZxtDc+u8gZEO2lymribJBvOBKBLdcj+x07jWQbbblHp6mZVbwgcyMJRK0MERUMMVc29F f837xFMA4HZhlzc7VaLYVOOsRwkLo97BDf1mvnQkmfGb5BF2TwneSYG65etoN9hECm8R p1YjFYcl8Ag+7LRrnCCNNKXa2flTdYMII8ejoinlsqUS79+UxZ7GlriQfTxtvEMYkneH ekyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694597351; x=1695202151; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n+MFrQb049CZGpD5Zjrkdb/5Mi4AniQ9UI6VaAP+DKI=; b=Jgs/CsY8fnxvTPmEVAlcYKGyXk5eQVgCjWR/azF18Y184op3SE/T9X3vmVGF/mt9RI FaMV7WVbuoAHNQlkhASosW5rXqfXzhqkFjLnSWN26eoBo7XYooH9B3qhc/xROauNehD7 so5n413SQsTBqJEx6dpLNnyTclvd5hqFm+k/0ipz5TztzoY4Ck1LFqzeBC06occ0LAGo oq8f5/EPXmIR7vsNiHV2cjp5yzCXobvDFl3UjgMObCu7c1N7HJJWVrk5BAk8n4HN1Kt+ xCnaqLwRrmwXHX7l61MMngswK1FjwzDQQiQ3BlFKmaHqRgK7F4XQUlTLCuVO8HCAH3Gv Aidg== X-Gm-Message-State: AOJu0Yzzt1SkhKNJRIOqJBGxnJPmNW+k6r4/6i3cRJaIUSnPIMYgdyV1 zdP9KTxjyCwHSnOyXQJ6bbOT86Bnc8fbztNNs92TtQ== X-Received: by 2002:a5b:982:0:b0:d78:341d:e475 with SMTP id c2-20020a5b0982000000b00d78341de475mr1702968ybq.44.1694597351319; Wed, 13 Sep 2023 02:29:11 -0700 (PDT) MIME-Version: 1.0 References: <20230913065421.12615-1-juerg.haefliger@canonical.com> In-Reply-To: <20230913065421.12615-1-juerg.haefliger@canonical.com> From: Linus Walleij Date: Wed, 13 Sep 2023 11:28:59 +0200 Message-ID: Subject: Re: [PATCH] wifi: brcmfmac: Replace 1-element arrays with flexible arrays To: Juerg Haefliger Cc: aspriel@gmail.com, franky.lin@broadcom.com, hante.meuleman@broadcom.com, kvalo@kernel.org, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, linux-kernel@vger.kernel.org, marcan@marcan.st, keescook@chromium.org, gustavoars@kernel.org, hdegoede@redhat.com, ryohei.kondo@cypress.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 02:29:28 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 morse.vger.email On Wed, Sep 13, 2023 at 8:54=E2=80=AFAM 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/brcm8= 0211/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/brcm8= 0211/brcmfmac/cfg80211.c:1126:27 > index 1 is out of range for type '__le16 [1]' > > for these lines of code: > > 6884 ch.chspec =3D (u16)le32_to_cpu(list->element[i]); > > 1126 params_le->channel_list[i] =3D cpu_to_le16(chanspec); > > Signed-off-by: Juerg Haefliger Obviously the right solution, thanks for looking into this! Reviewed-by: Linus Walleij Yours, Linus Walleij