Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp804486imu; Tue, 11 Dec 2018 07:51:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/WSvyeUZg71+tuP0QOGWI1FRDfxl5wFvqMuuonUYlW9CWD/8P1WHEKsHtwMY6GhZWrz3Dfr X-Received: by 2002:a63:801:: with SMTP id 1mr14851509pgi.275.1544543501707; Tue, 11 Dec 2018 07:51:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543501; cv=none; d=google.com; s=arc-20160816; b=Pqiy3ywRox3xOdqBFJ9xufMSSlPgKXcuFRnpfa39FcTJymKr5tCw4Voaw5qTN7SbGR 4Csg0nkGyrYddLia9PmQh83H0pRO8vB0dA9H14GMAFHkx1VtlxUFatiRmjLjEWjbGs5s GRf0hA7jFj3PuTbiS140Ifdn4ttMaE2lZLjRwCoa645czMYzOQ5tCbayPz0uNIazv19O 0QiwaF85S1ityeWochrpoT7O1/zdAGtiEOcpTCv4vh1Bf+sAIaARFWakRZJqrykT//6e eutWoLM96SJgQmmTnJpCVNk06PrULLYy24EZADOtWpZyd6VxHCtTjDkFMTBsyjg0afH/ dbFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Gx0DKkktiuoWC+4z4/fScFt5tOd4kIwQXsVNTHOQqy8=; b=uG8c3EA7nMjqX28K/lpJJw5PEZlN2tWPCwn41RzuyQqnJaMzKC5U1X5ns/YmJuafIm PgnbihPip98CF7TzFaQLLDbTfBiQk7L5g26EQhVNUCkIadi8ushEePPVuwaq17DjjTQ8 QnK4GXK4sUdh8bnLvZvfnzTlpxnF94gKhzbQ+l+JCQ4wnopV0rSg7uE3c9vGpkk7GvmX Je+zk8VLsz8/TJhDALVCZth8gCxwmv034DzmkeZCE/Nhu3cswnJoFI46x3KmR4jwMtrX ubZY3H8ErJbzYGStGNG+UYG0nALirWSNa2sbn9CGZY1IgxM+ZIJrDauRt1ytow/RFveB O61g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VpTCW6mK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 207si13369922pfz.249.2018.12.11.07.51.27; Tue, 11 Dec 2018 07:51:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VpTCW6mK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728838AbeLKPsg (ORCPT + 99 others); Tue, 11 Dec 2018 10:48:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:36944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728823AbeLKPse (ORCPT ); Tue, 11 Dec 2018 10:48:34 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7CDF220870; Tue, 11 Dec 2018 15:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543314; bh=DbTkrtTbs6ekCfL3duw1qqiA7tvUY8sL2yn3PS3vnFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VpTCW6mKch55ZkvmhGbn+y1DTqRajoHM0zb1hQp1qW3bhI7hR+QSz7G5CMPeD5nRO 8QvyWidE8mcQbML6xuZAuOVC7OoDDWk5pXTZPAknY5px4L3ivKw03PcXYfPx1AiOap O3GlB6I9NuhQqKzkqA+apTWgxi+5VkPDbibvAK7s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasyl Vavrychuk , Johannes Berg Subject: [PATCH 4.4 87/91] mac80211_hwsim: Timer should be initialized before device registered Date: Tue, 11 Dec 2018 16:41:46 +0100 Message-Id: <20181211151613.958492049@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vasyl Vavrychuk commit a1881c9b8a1edef0a5ae1d5c1b61406fe3402114 upstream. Otherwise if network manager starts configuring Wi-Fi interface immidiatelly after getting notification of its creation, we will get NULL pointer dereference: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [] hrtimer_active+0x28/0x50 ... Call Trace: [] ? hrtimer_try_to_cancel+0x27/0x110 [] ? hrtimer_cancel+0x15/0x20 [] ? mac80211_hwsim_config+0x140/0x1c0 [mac80211_hwsim] Cc: stable@vger.kernel.org Signed-off-by: Vasyl Vavrychuk Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/mac80211_hwsim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2515,6 +2515,10 @@ static int mac80211_hwsim_new_radio(stru if (param->no_vif) ieee80211_hw_set(hw, NO_AUTO_VIF); + tasklet_hrtimer_init(&data->beacon_timer, + mac80211_hwsim_beacon, + CLOCK_MONOTONIC, HRTIMER_MODE_ABS); + err = ieee80211_register_hw(hw); if (err < 0) { printk(KERN_DEBUG "mac80211_hwsim: ieee80211_register_hw failed (%d)\n", @@ -2539,10 +2543,6 @@ static int mac80211_hwsim_new_radio(stru data->debugfs, data, &hwsim_simulate_radar); - tasklet_hrtimer_init(&data->beacon_timer, - mac80211_hwsim_beacon, - CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - spin_lock_bh(&hwsim_radio_lock); list_add_tail(&data->list, &hwsim_radios); spin_unlock_bh(&hwsim_radio_lock);