Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp397759rdg; Tue, 10 Oct 2023 13:43:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGJZj38pcDe4MAe7CKgw/84p6mqzEC8w7uyYP0VuA4+cnF921MDEat/6tCOwANymWr7xsb X-Received: by 2002:a05:6a00:2e96:b0:68b:c562:da65 with SMTP id fd22-20020a056a002e9600b0068bc562da65mr19526705pfb.26.1696970594082; Tue, 10 Oct 2023 13:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696970594; cv=none; d=google.com; s=arc-20160816; b=PGyx5xiu4xd7T5tMlhwMsZfXaSjHZ4VWt3OByAYDTK6KmikUJOVPzv/tIlrC6Jx3cS AtakxQflIq0JxAK/4swfDjSChMIVxJyvD1l7Yk5w8nwPjcePHml/HFIjyXTKT5UAMZFU EzCLKlbEjaTNrkRlpStlvf/ophEzUw3xBhOsbdONzzM9H7IztRxq8eIwnjQlsr5cjFXK vtCa6x/iCEsiuS81qosvZ4ges9V7xck8kB2tt/WKrlDvD6IQbLjJLa3Uz7yED8W63sUE FaHUB38sY6C4Lctzbu+YG6LMHKSfNm43LmfSJMahmj02T8f6Xhw56U0TGKy94RSlyxLn LMKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cJ7qBg0sgvbtjbaMF3kiM4Gox7ddpQ2d3bhgQqglVpA=; fh=kiH9BsJ+TyHZ/0f9lp96S1R8k/374lMiI4doNuDXH6k=; b=JPrYPD13XLUfiWUvGS8LUwd75o2ORnFhwQsJiEI7ywYKHHxB6/0fnoZlyRSjPiAuzf 4swxTJJmUgpg6RYMhvlv7bgEhrlH7bUkkNqx61VYQoYTQjwCzQnkwlPbvTn/0HWv9QW0 5nEzoMeRaW/K8OEhDKtfXyVYEMJuXFVMFMlYw8e0B7xm4a4Ye/3ks4tsLz4DqduFeDN6 K2Hrax8WtN0mkv33X0rGDDOcjP9QJLYKvqDIIejZpsVhKkoi2FEqFF4Wj6NAfHK4elui V3pSeJBmvq28ajYz9PE7jwiUHoQyG8dMvQi1dMrHtegoxjzg3VKbxcvF95Ys1ShMdgf8 l3sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gFC00mQB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bv7-20020a056a00414700b00690c75e54e1si7457436pfb.402.2023.10.10.13.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 13:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gFC00mQB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5E26E807F491; Tue, 10 Oct 2023 13:43:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229726AbjJJUm4 (ORCPT + 52 others); Tue, 10 Oct 2023 16:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234598AbjJJUmy (ORCPT ); Tue, 10 Oct 2023 16:42:54 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA205B6 for ; Tue, 10 Oct 2023 13:42:45 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9adb9fa7200so52192066b.0 for ; Tue, 10 Oct 2023 13:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696970564; x=1697575364; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cJ7qBg0sgvbtjbaMF3kiM4Gox7ddpQ2d3bhgQqglVpA=; b=gFC00mQBZQL3//LtS28NtLWz/c73+y5p57iKM5sFHBcg9WClYg9FTJ+u6X/aAk5r9G 4EnydRMCIiBUsIKGXnWk217x8SqBbY6TZg5KJFvno0TIGWkLK6fcmPYnWduQbmMlIs8d 0jUygBhADxdxObJr2ABABQhca4E0Tt/1QC2DGirRDpkd/h1BzqBxZJvuHCjYSzNkigHp 6dEo9h5bJyq2qrFEQ/RkoU8zfhIdrwB1hdwyzmWLfBce1NELdpCKvY518L+/ZkOOKK3d EAsqLk5W41/d0mdVnWSjcIMbbkIDvSEmLGgeqIbngPqdP/5f786+L/TOlqGXjcHWgtog 5iag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696970564; x=1697575364; h=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=cJ7qBg0sgvbtjbaMF3kiM4Gox7ddpQ2d3bhgQqglVpA=; b=PfyQpSN8u+d/TmENWbYtyrsItpASW7Zmn9CO9o9rf4XLXwt5nHPbNHUYvCQ/sudevb Lxyply3Ibyj0p7BBBzvH5aAgz0fkChaVlfYH0i2XswMOG+fIitPVjeSkJo4K6VF2m8CZ PmNMGPsHb7ZiTxiFJKkBBdhV6i9Wtx0ivHSVHzCZcSidbddwAlFqlN2N04N2jscDmMLi ZzNxzILbAu16tcRSHv0NtZyZpqWw5ej9rCvuwrwo3+0/wYsZMzv5uoy+JDI8jbOtQuai BKVERwQ3bJXqb/lvIGECT8hS++ZincFqE4MXi3mpUI/C5rRYK2oH3+0ldEZDUsgrR9l0 B5DA== X-Gm-Message-State: AOJu0YzM8W8DYO29uLOuPWt0wY6V0dO96H0WYLmWGukQCyjGcKxaFCMg lUJeBn4tek6s1V+BPtW1B9tl8Kvk0YE2VNrKv3wq5zm0Ecw= X-Received: by 2002:a17:907:808:b0:9b2:cee1:1f82 with SMTP id wv8-20020a170907080800b009b2cee11f82mr13004527ejb.7.1696970564116; Tue, 10 Oct 2023 13:42:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: James Dutton Date: Tue, 10 Oct 2023 21:42:07 +0100 Message-ID: Subject: Re: mac80211 bugs To: Johannes Berg Cc: linux-wireless@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 13:43:05 -0700 (PDT) X-Spam-Level: ** On Tue, 10 Oct 2023 at 15:22, Johannes Berg wrote: > > On Mon, 2023-10-09 at 16:56 +0100, James Dutton wrote: > > > > Looking at this, it can be one of two things: > > 1) local->hw.wiphy->bands[band]; is NULL > > Yes, I think that's it. > > > 2) bands is an array of 6 items, making band valid for values 0-5. > > If band >= 6, it would cause problems. > > Highly unlikely. > [snip] > > _Maybe_ change it to WARN_ON_ONCE(!sband || !sband->bitrates) there, but > really I think we should prevent this in the first place. > > > Is this, by any chance, a device without 2.4 GHz? > Hi, I have the same device that is reported to be crashing. My device does not actually crash, so I personally have not seen the problem. My device is what I would call unstable (not crashing, just not forwarding packets) though. My work around is to switch on/off airplane mode on the client, and it continues forwarding packets again. Some of the wifi device drivers have some not very portable use of bit fields that looks suspicious to me, but again no proof yet of what causes my stability problems. It is why a lot of access to bit fields in the kernel correctly uses portable accessors like STA_STATS_GET() and friends. I have seen this though: https://github.com/openwrt/openwrt/issues/13198 Which has reports of a few other people seeing the crash. The device has both 2.4 and 5G wifi. From what I can see, the band information originates from what the wifi card received over the RF. So, theoretically, it might be caused by a bogus wifi packet being received. I agree that it is unlikely for "band" to get to 6 or above, but until one of the users who are seeing the problem runs a kernel with the extra printk or WARN statements in it, I don't think we are going to know the cause for certain. I think it prudent to put the if statements in to catch both edge cases.