Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2418792rwd; Mon, 15 May 2023 11:22:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6yVFMtpXp5zPnSsUSkK+OSG874CWgA0SGKGuycfGMZ1shBWuL/Gx2Ym0A3jsTacAS1jCob X-Received: by 2002:a05:6a20:8409:b0:101:c6ee:4996 with SMTP id c9-20020a056a20840900b00101c6ee4996mr27076874pzd.12.1684174954840; Mon, 15 May 2023 11:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684174954; cv=none; d=google.com; s=arc-20160816; b=wjcY1SIYZvjbBfsrCdJOmHWaZlpGBnHHEzPsT1v2q0OqusfETc+nmw5Xo/vaxh67HB yZ8KZsXY3bQcWZbMdZcs/OsUiMS6WFeyXyDbzCGWL616RRvhF8NZmJwB26DPTQgnOiiR SbStNkh1M/HcXJgObqn05RHkKOLBL210e2lngSn065Bppkvg38ZhzRhoj+AckCCq+zup wJTYazTQrTBZ8wODURP6C7eFxlaKXvq1jmMok+j9vURQsSH6rVFV767Wv7VuQi87PvGs jmoIHGcicluLWuBWbN2RHnwB/AWaX/ZtPoJAVpdbvDtimjvFlH6Jj5npkU5pSeutP4CA a6uA== 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=EtvF2RbrYQnPC6kU1wGH8R+D7QXd2LhEys5g/6fIfLg=; b=zedgPuXlSTPjAuz+WlUn4Fcyio3NxGLXBj0FkHzWsVyOucC/YiLlH766k1KuBY1hpS XK/YVZu7mZN2AlpePSekoyAKd4fPzLHHcpAIXXSZZI4lCtzgNa4bL8wJLi33wtfDyPPt j4atzrddyP8b6RIWPTRNYv9Ex7N+8PSr5sCKXrOqhRugPQamn6O2dTGu2UCNZVD9sqNs t9VnIlZYpNZGaD9wq73h1bSAIqKXsMEY5J2rD9ty6u61kSht6OF9e5TbJ+QoFyY9JNV1 JYG9Zei7X2HS1j5Co4unviD1HU3Xxj5m5We3MhiyZL7wteefuTG5AH3i5hWLUzAk2QTM GDDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pJk9W1N/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v202-20020a6361d3000000b0050f89421524si16566366pgb.319.2023.05.15.11.22.27; Mon, 15 May 2023 11:22:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pJk9W1N/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245214AbjEOSUp (ORCPT + 61 others); Mon, 15 May 2023 14:20:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245233AbjEOSUX (ORCPT ); Mon, 15 May 2023 14:20:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D079918871; Mon, 15 May 2023 11:19:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1BA9663139; Mon, 15 May 2023 18:19:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0548BC433EF; Mon, 15 May 2023 18:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684174745; bh=lXn4/zb+8zA/44joIb7RJ/8M0SqiyaD6fWxJaePD334=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=pJk9W1N/tU7YdZNKnWhelPsah1WtS6AEMRSG50aD1YXSNJxvFu5ulgwikz42uZEzu cQ7Xxxsbf8GVFomC3xjsw71xEfd7hmIuZURcOmooCoehdJd8IXqhTa8V/FCAkiEh+U R421aoEQYuQhflN+ASSNhExsoNdak9aYBFAw53gdQjbrBcv5WG/8fI3RKcWN8h8E4F UIx7Dsl35Pj1Jt4RCdpMOsxQFugRCdHpbAeBRiwSmV/9x5c3ASBmlBzpWk47BXVUH6 6y9g202U+s7sUeJkYyMIS6q7HS5VPMIc2ewW0feGLSrq3yT6XPT4xhGuH8uGmQRsZL jVtTVzX2nfw8w== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [v2] wifi: brcmfmac: Check for probe() id argument being NULL From: Kalle Valo In-Reply-To: <20230510141856.46532-1-hdegoede@redhat.com> References: <20230510141856.46532-1-hdegoede@redhat.com> To: Hans de Goede Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Hans de Goede , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, regressions@lists.linux.dev, Felix , Arend van Spriel , stable@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <168417474077.32723.9868823702580384780.kvalo@kernel.org> Date: Mon, 15 May 2023 18:19:02 +0000 (UTC) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hans de Goede wrote: > The probe() id argument may be NULL in 2 scenarios: > > 1. brcmf_pcie_pm_leave_D3() calling brcmf_pcie_probe() to reprobe > the device. > > 2. If a user tries to manually bind the driver from sysfs then the sdio / > pcie / usb probe() function gets called with NULL as id argument. > > 1. Is being hit by users causing the following oops on resume and causing > wifi to stop working: > > BUG: kernel NULL pointer dereference, address: 0000000000000018 > > Hardware name: Dell Inc. XPS 13 9350/0PWNCR, BIDS 1.13.0 02/10/2020 > Workgueue: events_unbound async_run_entry_fn > RIP: 0010:brcmf_pcie_probe+Ox16b/0x7a0 [brcmfmac] > > Call Trace: > > brcmf_pcie_pm_leave_D3+0xc5/8x1a0 [brcmfmac be3b4cefca451e190fa35be8f00db1bbec293887] > ? pci_pm_resume+0x5b/0xf0 > ? pci_legacy_resume+0x80/0x80 > dpm_run_callback+0x47/0x150 > device_resume+0xa2/0x1f0 > async_resume+0x1d/0x30 > > > Fix this by checking for id being NULL. > > In the PCI and USB cases try a manual lookup of the id so that manually > binding the driver through sysfs and more importantly brcmf_pcie_probe() > on resume will work. > > For the SDIO case there is no helper to do a manual sdio_device_id lookup, > so just directly error out on a NULL id there. > > Fixes: da6d9c8ecd00 ("wifi: brcmfmac: add firmware vendor info in driver info") > Reported-by: Felix > Link: https://lore.kernel.org/regressions/4ef3f252ff530cbfa336f5a0d80710020fc5cb1e.camel@gmail.com/ > Cc: stable@vger.kernel.org > Signed-off-by: Hans de Goede > Reviewed-by: Arend van Spriel Patch applied to wireless.git, thanks. 60fc756fc8e6 wifi: brcmfmac: Check for probe() id argument being NULL -- https://patchwork.kernel.org/project/linux-wireless/patch/20230510141856.46532-1-hdegoede@redhat.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches