Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4522081rdb; Tue, 12 Dec 2023 01:42:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyJoV3e2oTEkAyX2DV8MdeJVPMT5ymuJ3H6bFO/WddIVCjpqTDXV+hJqXQLu3sTJqs1Bat X-Received: by 2002:a05:622a:11c9:b0:425:4043:1da9 with SMTP id n9-20020a05622a11c900b0042540431da9mr8578672qtk.124.1702374177025; Tue, 12 Dec 2023 01:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702374177; cv=none; d=google.com; s=arc-20160816; b=qm09ShBbZhpIJZscd/1TcPxe4RGRMpZLhl5g1+j3vi8CRi2lFS5rE3JhCrKhma/F9m q+UFppNxXz6xlKHvQB77hpfokDa5xt1Qih/fTwbyCVPPDuSSGpzSfMcfGIPHpye66Ju4 jAZJ2Nx+Bj5XiB6xq9mGSuCY5osZDwcfEcXrUqzLJy8ceVB0LEua3QekNOOuW0/35c8E IBx3Fw4LqTdobtz+v7xRshmzKcsoU45Vz9eMwkPzB+w2jKg4qsn51cw7MVD9qzENnCHv RjYlYyuj+9hX6UYUhdcyEkcZi932gk9Hu61sTJUaOMD8isuYsUWc4B74YlIooaN0jUUl FK9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tLGoCCqEwS5Rzm6vkLqOJ5b4zPigqMnDTy/qrc3lO8U=; fh=3HzOiOc0kO/OyaEWRz+NmCmQaJEL2conI85Dgxf+J94=; b=LO2IY0wLcjIAS2Vw7vHpEdsmGHkj7SJuevhCXrnN79QnE9eBpRenOgKrB2qmeK3vm6 YbOjLbgifjAm4QB/fOwIq9wD9mNFOb2b7rYF4jqbYWY82gbyoqm31qW7+5bghl3+pMcS opaLx4gkQGxu0TSfh0KMNxQaD4y0D+i1N0qFsxTnSR3/DThg4Vnd1vz1QxMPyjB6Q0wp SabH5KuNRF/oIgGDyEFezuev9aQ3X68ZZMBdj1iYJnZv1jj3iyA2Z7WGzr0CRrC+E87m KDgeQLW9BMyLbWmjC4E5On7gYXrMSPA6UBr6goboKryQqwqxAdhzf7+XgDyqmmYIqhFi 953Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QZZDaECK; spf=pass (google.com: domain of linux-wireless+bounces-692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-692-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 fb8-20020a05622a480800b004237f54a7f2si11424485qtb.191.2023.12.12.01.42.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 01:42:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-692-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=QZZDaECK; spf=pass (google.com: domain of linux-wireless+bounces-692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-692-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 B18591C212A2 for ; Tue, 12 Dec 2023 09:42:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CCDA58AA6; Tue, 12 Dec 2023 09:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QZZDaECK" 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 42140433DE for ; Tue, 12 Dec 2023 09:42:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12753C433C8; Tue, 12 Dec 2023 09:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702374173; bh=muw+Ud0YjfawGe9Cq2DB3pHB3fHCLByUAzvENR+KUes=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QZZDaECK3qYLvq+KzWWIGu/tekcFSES+1JnM7EEKKVENT3sxhN5vJdU17UqdlLvU7 LmDhRg8bQP8EBl+ppzA+4IH6LqqHZDzrgnVNsyL2Hyi6nBV2dRZtr0KxawXrv5godC Nl7g2BCzCHmLWdndiQbrwn+8NAcUvMZxMQAT2LQB4KkylKPJ5jT218UbZxOqF1ylUM hHLXKkjR6kjTEFM7MvOjrqQCaJQITRvM9EvIQl7TYlOdMzBNr0f5t21Kx2+VFsWtii KrNHpXrGSV9JYkUreY1d8xDzyQwc95ivuQuE7bnxrebWzaNonWf9CSKY2T2JUSyV9i rSJSizzbKr24Q== Date: Wed, 18 Oct 2023 10:09:10 +0200 From: Lorenzo Bianconi To: Kalle Valo Cc: Deren Wu , Felix Fietkau , Jakub Kicinski , "David S . Miller" , Eric Dumazet , Paolo Abeni , Sean Wang , Soul Huang , Ming Yen Hsieh , Leon Yen , Eric-SY Chang , KM Lin , Robin Chiu , CH Yeh , Posh Sun , Stella Chang , Quan Zhou , Ryder Lee , Shayne Chen , AngeloGioacchino Del Regno , linux-wireless , linux-mediatek Subject: Re: [next v2] wifi: mt76: mt7921: fix kernel panic by accessing invalid 6GHz channel info Message-ID: References: <871qds31rw.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oyYY5ye5rkYVGNeM" Content-Disposition: inline In-Reply-To: <871qds31rw.fsf@kernel.org> --oyYY5ye5rkYVGNeM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > Deren Wu writes: >=20 > > From: Ming Yen Hsieh > > > > When the chip not support 6GHz capability, the channels of 6GHz informa= tion > > should not be updated. > > > > May get the stacktrace without this patch. > > <1>[ 19.442078] Unable to handle kernel NULL pointer dereference at > > virtual address 0000000000000014 > > <1>[ 19.457535] Mem abort info: > > <1>[ 19.465329] ESR =3D 0x0000000096000004 > > <1>[ 19.473295] EC =3D 0x25: DABT (current EL), IL =3D 32 bits > > <1>[ 19.482354] SET =3D 0, FnV =3D 0 > > <1>[ 19.489143] EA =3D 0, S1PTW =3D 0 > > <1>[ 19.495991] FSC =3D 0x04: level 0 translation fault > > <1>[ 19.504554] Data abort info: > > <1>[ 19.511111] ISV =3D 0, ISS =3D 0x00000004, ISS2 =3D 0x00000000 > > <1>[ 19.520269] CM =3D 0, WnR =3D 0, TnD =3D 0, TagAccess =3D 0 > > <1>[ 19.528988] GCS =3D 0, Overlay =3D 0, DirtyBit =3D 0, Xs =3D 0 > > <1>[ 19.537960] user pgtable: 4k pages, 48-bit VAs, pgdp=3D0000000102= 7a9000 > > <1>[ 19.548014] [0000000000000014] pgd=3D0000000000000000, p4d=3D0000= 00000000 > > <0>[ 19.558429] Internal error: Oops: 0000000096000004 [#1] PREEMPT S= MP > > <4>[ 19.568270] Modules linked in: mt7921e mt7921_common mt792x_lib > > mt76_connac_lib mt76 mac80211 btusb btintel cfg80211 btmtk snd_sof_ipc_= msg_ > > btrtl snd_sof_ipc_flood_test btbcm bluetooth snd_sof_mt8195 uvcvideo > > mtk_adsp_common snd_sof_xtensa_dsp uvc snd_sof_of snd_sof videobuf2_vma= lloc > > ecdh_generic ecc snd_sof_utils cros_ec_lid_angle cros_ec_sensors crct10= dif_ > > cros_ec_sensors_core cros_usbpd_logger crypto_user fuse ip_tables ipv6 > > <4>[ 19.614237] CPU: 1 PID: 105 Comm: kworker/1:1 Not tainted > > 6.6.0-rc6-next-20231017+ #324 > > <4>[ 19.625957] Hardware name: Acer Tomato (rev2) board (DT) > > <4>[ 19.634970] Workqueue: events mt7921_init_work [mt7921_common] > > <4>[ 19.644522] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS= BTY > > <4>[ 19.655182] pc : mt7921_regd_notifier+0x180/0x290 [mt7921_common] > > <4>[ 19.664983] lr : mt7921_regd_notifier+0xd4/0x290 [mt7921_common] > > <4>[ 19.674679] sp : ffff800080acba80 > > <4>[ 19.681649] x29: ffff800080acba80 x28: 0000000000000000 x27: ffff= 4faf > > <4>[ 19.692483] x26: 0000000000000000 x25: 0000000000000000 x24: ffff= 4faf > > <4>[ 19.703294] x23: 00000000ffffe926 x22: ffff4faf16031fa0 x21: 0000= 0000 > > <4>[ 19.714108] x20: 000000000000001c x19: ffff4faf16ba6f40 x18: 0000= 0000 > > <4>[ 19.724928] x17: 0000000000000000 x16: ffffac6b891c2750 x15: ffff= 8000 > > <4>[ 19.735722] x14: 0000000000000180 x13: 0000000000000000 x12: 0000= 0000 > > <4>[ 19.746478] x11: 0000000000000002 x10: ffff4faf01c21780 x9 : ffff= ac6b > > <4>[ 19.757214] x8 : 00000000006c0000 x7 : ffffac6b6b020cf0 x6 : ffff= ac6b > > <4>[ 19.767945] x5 : ffffac6b6b020d00 x4 : ffffac6b6b020cf8 x3 : ffff= 4faf > > <4>[ 19.778648] x2 : 0000000000000000 x1 : 000000000000001c x0 : 0000= 0000 > > <4>[ 19.789366] Call trace: > > <4>[ 19.795381] mt7921_regd_notifier+0x180/0x290 [mt7921_common] > > <4>[ 19.804675] wiphy_update_regulatory+0x2bc/0xa08 [cfg80211] > > <4>[ 19.813864] wiphy_regulatory_register+0x4c/0x88 [cfg80211] > > <4>[ 19.823029] wiphy_register+0x75c/0x8d0 [cfg80211] > > <4>[ 19.831446] ieee80211_register_hw+0x70c/0xc10 [mac80211] > > <4>[ 19.840479] mt76_register_device+0x168/0x2e8 [mt76] > > <4>[ 19.849008] mt7921_init_work+0xdc/0x250 [mt7921_common] > > <4>[ 19.857817] process_one_work+0x148/0x3c0 > > <4>[ 19.865292] worker_thread+0x32c/0x450 > > <4>[ 19.872489] kthread+0x11c/0x128 > > <4>[ 19.879173] ret_from_fork+0x10/0x20 > > <0>[ 19.886153] Code: f0000041 9100a021 94000aef aa0003f9 (b9401780) > > <4>[ 19.895634] ---[ end trace 0000000000000000 ]--- > > > > Reported-by: AngeloGioacchino Del Regno > > Closes: https://lore.kernel.org/all/927e7d50-826d-4c92-9931-3c59b18c694= 5@collabora.com/ > > Fixes: 09382d8f8641 ("mt7921: update the channel usage when the regd do= main changed") > > Signed-off-by: Ming Yen Hsieh > > Signed-off-by: Deren Wu > > Tested-by: AngeloGioacchino Del Regno > > Reviewed-by: AngeloGioacchino Del Regno >=20 > I assumed I should take this directly to net-next so assigned to me on > patchwork. Felix&Lorenzo, ack? Fine to me. Regards, Lorenzo >=20 > --=20 > https://patchwork.kernel.org/project/linux-wireless/list/ >=20 > https://wireless.wiki.kernel.org/en/developers/documentation/submittingpa= tches --oyYY5ye5rkYVGNeM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZS+SowAKCRA6cBh0uS2t rGpkAQDZhGGAUcw9Dh76XkrAld+ZUdn5iroV0rrxkzsMCKpJlQEAt0vb6Tqj30h5 7JtqAzP9eyWQ1Xn7KwJV/Zrr6HMgtg4= =hYdm -----END PGP SIGNATURE----- --oyYY5ye5rkYVGNeM--