Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1379259imm; Sat, 4 Aug 2018 02:10:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc6GX4yuWvipwci3rwEL3LeOXd5fe4O1kv+qPsFYn6/Huw/BPIIROw/sC7fZ3tYkGq/V1o5 X-Received: by 2002:a63:f919:: with SMTP id h25-v6mr6769514pgi.401.1533373852316; Sat, 04 Aug 2018 02:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533373852; cv=none; d=google.com; s=arc-20160816; b=FqDXtjQAtAECOi58tcGSCwYqZ+0+f84X7mdxKHF9zx5BIS0t7NaHW0/lGSf/Ujb4aR XDmSLRTmHxPk+Nfl0ek/0JcvXBHMZ2ybgTqrwP93yIGbmPKag1FOoSpF5c7lUT7sEPou ZvlqXVuV6ndeu65GKED8e/b5m/TUa0TM9jprS+UevDAlISr05G3EBg3BhxX22koOLceR zQay+deyginf56ewbzNzz3FbxWZmgHpz/1XnU+nu84u3GOhTikpFutn46d+o8tRaF7yj 6jhe/GwwyYeC70cfdTkfhtwKcfVSNXM437tF+iPxhZj+8dj5K3/QKKZUIJ1XMhF3hdKg /jog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YWqVSw+TmO7tPrhtQdJB+u3v0XcCUoazzrlSf2sZVsQ=; b=EcRQj74GfkBgoxLqtuAFYPnMnPLxOR03TtVcql8y1BZpYmHefZMCbUwm8wcM/M+4tv VAOQ+B923omb4CekWJHs7kaOCDa6DjLsu1vOjSspyjyTacU26swjpEhXjDE+oG7/0ee/ DiXoDT/Y0cDhdSkQFivHD6LRaPsM+3R2arSt/futKlwJ3oKbGLFVAnedzLzIx25E3hFu sTsBt+61df4X/5iIfbBgA85ZufMrVkZj8hsNXHiE4LJSjQIs7D9LhFubz5HkVqO61KEk xrxnL4/T4Hnx8UntmPIRduph/bAnfNfruIpevPGGo/K+Iq6JR3jf465u0FTBSjb2Ekj5 kXgg== ARC-Authentication-Results: i=1; mx.google.com; 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 b2-v6si6201612pge.114.2018.08.04.02.10.38; Sat, 04 Aug 2018 02:10:52 -0700 (PDT) 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; 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 S2388736AbeHDLJb (ORCPT + 99 others); Sat, 4 Aug 2018 07:09:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49822 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbeHDLJb (ORCPT ); Sat, 4 Aug 2018 07:09:31 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9EF13BB3; Sat, 4 Aug 2018 09:09:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shaul Triebitz , Luca Coelho , Sasha Levin Subject: [PATCH 4.4 026/124] iwlwifi: pcie: fix race in Rx buffer allocator Date: Sat, 4 Aug 2018 11:00:15 +0200 Message-Id: <20180804082703.421702408@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180804082702.434482435@linuxfoundation.org> References: <20180804082702.434482435@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Shaul Triebitz [ Upstream commit 0f22e40053bd5378ad1e3250e65c574fd61c0cd6 ] Make sure the rx_allocator worker is canceled before running the rx_init routine. rx_init frees and re-allocates all rxb's pages. The rx_allocator worker also allocates pages for the used rxb's. Running rx_init and rx_allocator simultaniously causes a kernel panic. Fix that by canceling the work in rx_init. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/iwlwifi/pcie/rx.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c @@ -713,6 +713,8 @@ int iwl_pcie_rx_init(struct iwl_trans *t WQ_HIGHPRI | WQ_UNBOUND, 1); INIT_WORK(&rba->rx_alloc, iwl_pcie_rx_allocator_work); + cancel_work_sync(&rba->rx_alloc); + spin_lock(&rba->lock); atomic_set(&rba->req_pending, 0); atomic_set(&rba->req_ready, 0);