Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2140246iof; Tue, 7 Jun 2022 21:05:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+DwNqQz/Hp4poYyjyKTVMDroi+0278MlET/mUh9eDy2NaViy9LxypKHbA+OpQzApeIAbd X-Received: by 2002:a05:6a00:2402:b0:4e1:46ca:68bd with SMTP id z2-20020a056a00240200b004e146ca68bdmr32417009pfh.70.1654661143325; Tue, 07 Jun 2022 21:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661143; cv=none; d=google.com; s=arc-20160816; b=CI5SbxXNrWKL2HB46jnNNbAi+NfK/UO6OaMB7cocrG3gFbIE+fj3bCphg81C98odr3 R7FBZIGMBpZe6oYGpKfSTN4P4tB8NG+Ub+WlW9Ql92mby7TNRjofjSBahhkoR/YngkUm Z9fotRsVyXr7OWkNFkYIIykLG3T/sKpb0Br2R2d6N2KckYzZD1hUvSnLvg/TzrA/0PK5 zcyAU/HrRkbZv3AqeM0kh2iwPU1O5QEU4E5im4cNG2p+hfZf4TbH9Mioe/FcpQga2l9Y zCey1DnWTXObd68gGNcNlfjaAZ3eMUoLFrTOrBKi1yQRAnYNwClpyoTPfBTIf2JBp0Ef T2kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2ZrQ1PI8JmwmJNHxXWIMkxi8gziU7LSSbMFSUINiFaM=; b=zc4Yav9JohR+ZRvfc3qHKay70dCkgKG8RF6YGHkaysvJ2pRbf54dzEN+GWGwGw16y9 Bf35Vjr+cid3BX7PYHCYWaUxSMdOavV6fE2D2uyGj2T5ilGrq5KqAUl5uvrPSf9xqGhN VWcP9YDBGqeuPmnOO9/tlGkJrYe1dDJQIdCThWf1q5PCPBX9IRpgZuVeU4OGkes3cwg/ PWUkIAnGtaIp/kIr/4qF2BhjYUB7/91vbqg9amS2sHOfikOiS4rJixIJI6/hGnW1K7SM O7uDxlpLjEwIiip4xA9RRmD/HRtB0HUpDNphUVTsVIWDxo3FV8BGc+eMBE1KnUtioqC2 K/MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nbdeqBHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p67-20020a625b46000000b0051ba765f335si24846718pfb.235.2022.06.07.21.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nbdeqBHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 50A6121913D; Tue, 7 Jun 2022 20:33:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385868AbiFGWrR (ORCPT + 99 others); Tue, 7 Jun 2022 18:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380835AbiFGViP (ORCPT ); Tue, 7 Jun 2022 17:38:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E44FCE5280; Tue, 7 Jun 2022 12:05:22 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8EB21B822C0; Tue, 7 Jun 2022 19:05:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA5A4C385A2; Tue, 7 Jun 2022 19:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628720; bh=LbqyjluyiwqorG7sAuTBbY2h6uEWrKDh7XnSBWLGDfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbdeqBHPZ8rvSQ1cqjVt2zrroy/OPILInFjdRPrakA51t46xk417S+XVB9gm9xXOM CgQMf8z9NQGwQGHLXo1xHkvLjh3cjZsH3uLxu6GIrDE8OHYtKrXrJbkfOddq9rtTxI Ads+m3lmnESMfE1HShJUYH4x61liIa6iypLCjqaw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ajay Singh , Kalle Valo , Sasha Levin Subject: [PATCH 5.18 414/879] wilc1000: fix crash observed in AP mode with cfg80211_register_netdevice() Date: Tue, 7 Jun 2022 18:58:52 +0200 Message-Id: <20220607165014.878285008@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-kernel@vger.kernel.org From: Ajay Singh [ Upstream commit 868f0e28290c7a33e8cb79bfe97ebdcbb756e048 ] Monitor(mon.) interface is used for handling the AP mode and 'ieee80211_ptr' reference is not getting set for it. Like earlier implementation, use register_netdevice() instead of cfg80211_register_netdevice() which expects valid 'ieee80211_ptr' reference to avoid the possible crash. Fixes: 2fe8ef106238 ("cfg80211: change netdev registration/unregistration semantics") Signed-off-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504161924.2146601-3-ajay.kathat@microchip.com Signed-off-by: Sasha Levin --- drivers/net/wireless/microchip/wilc1000/mon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/mon.c b/drivers/net/wireless/microchip/wilc1000/mon.c index 6bd63934c2d8..b5a1b65c087c 100644 --- a/drivers/net/wireless/microchip/wilc1000/mon.c +++ b/drivers/net/wireless/microchip/wilc1000/mon.c @@ -233,7 +233,7 @@ struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl, wl->monitor_dev->netdev_ops = &wilc_wfi_netdev_ops; wl->monitor_dev->needs_free_netdev = true; - if (cfg80211_register_netdevice(wl->monitor_dev)) { + if (register_netdevice(wl->monitor_dev)) { netdev_err(real_dev, "register_netdevice failed\n"); free_netdev(wl->monitor_dev); return NULL; @@ -251,7 +251,7 @@ void wilc_wfi_deinit_mon_interface(struct wilc *wl, bool rtnl_locked) return; if (rtnl_locked) - cfg80211_unregister_netdevice(wl->monitor_dev); + unregister_netdevice(wl->monitor_dev); else unregister_netdev(wl->monitor_dev); wl->monitor_dev = NULL; -- 2.35.1