Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3277336ybb; Mon, 6 Apr 2020 05:54:43 -0700 (PDT) X-Google-Smtp-Source: APiQypKdVN0ToZ4yxjf56j5LkptT0/ejH7pL+FiRo8/BVjUNKxYjSbc4Io46fYVLHrVDMnoEZuVU X-Received: by 2002:a9d:1904:: with SMTP id j4mr17704081ota.37.1586177683704; Mon, 06 Apr 2020 05:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586177683; cv=none; d=google.com; s=arc-20160816; b=tSAIRcRFnFe8YQSgY5ZdRocgrXICzcsAjd5p2l1Fcg62pTBj14LkQ/6xfz0ZT9b1Sp GzjRyqJfMN40P913KyJbuSQImIxLdIXBrRxenGI6rauwaEQlRovDhRbzEw1/++67F1m4 4i4oaM+xj42MobqAfrUqVpqEPxb4sV1oAWW3AH+d/m8bqWZW10/9kywk8sMZOIj11CFb HMXj6sHWCZOMkxxNy7t+wgz3c/h+xjGY82nYWqWGTbTROVaGRbFmJP4moERp4IHhtpnI A1UYnJdn8ubtMaqbBmWIeVBA2pv7t3bPaNjM6EJUqBx6DyDkMjPvPySMQ9vhgXsEbe8k pU3g== 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:date:cc:to:from:subject :message-id; bh=ltqmUIp+KFGNigjiFV4/TrN6DL2AsSMmZpNIVrKOYTM=; b=heHwB3c0aEd3fI5gcQi5pDC9sPvsTCqa4LzbYLZW8eG2Z++wjmhfr+wtSNS7s802SK a5qj9a2CRCuEGT/CMKBZ2Q5m4Xf1p5cv6AyFyrh+4tioE2TbnPMNOt1a9G2lsBXI1q0r X6qORMlkwlsULvWnYFqe2EQEYWaXVKAAeDLpSL1TBVm/QVTdo0sF1XOS2RdZvo9D3Db3 hMrR/wZyjOsM81u3gs2jjxXl9t4m0kR31RHOug73RjCvb6k9lIxPE7/ps6TRuGb7MrPD DqnI2n9qIRjuAhxRoODHvl85y9I3YlkOdD0npTlYxG4rklx4VxtaCzIVHjlbrHHOGX/A +e4A== 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 a21si9675206otk.277.2020.04.06.05.54.31; Mon, 06 Apr 2020 05:54:43 -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 S1728220AbgDFMyE (ORCPT + 99 others); Mon, 6 Apr 2020 08:54:04 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:58000 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728041AbgDFMyD (ORCPT ); Mon, 6 Apr 2020 08:54:03 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jLRGB-009m8o-JX; Mon, 06 Apr 2020 14:53:51 +0200 Message-ID: Subject: Re: [PATCH] mac80211: fix race in ieee80211_register_hw() From: Johannes Berg To: Kalle Valo Cc: Sumit Garg , linux-wireless@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, matthias.schoepfer@ithinx.io, Philipp.Berg@liebherr.com, Michael.Weitner@liebherr.com, daniel.thompson@linaro.org, loic.poulain@linaro.org, stable@vger.kernel.org Date: Mon, 06 Apr 2020 14:53:49 +0200 In-Reply-To: <87r1x0zsgk.fsf@kamboji.qca.qualcomm.com> References: <1586175677-3061-1-git-send-email-sumit.garg@linaro.org> <87ftdgokao.fsf@tynnyri.adurom.net> <1e352e2130e19aec5aa5fc42db397ad50bb4ad05.camel@sipsolutions.net> <87r1x0zsgk.fsf@kamboji.qca.qualcomm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-04-06 at 15:52 +0300, Kalle Valo wrote: > Johannes Berg writes: > > > On Mon, 2020-04-06 at 15:44 +0300, Kalle Valo wrote: > > > > user-space ieee80211_register_hw() RX IRQ > > > > +++++++++++++++++++++++++++++++++++++++++++++ > > > > | | | > > > > |<---wlan0---wiphy_register() | > > > > |----start wlan0---->| | > > > > | |<---IRQ---(RX packet) > > > > | Kernel crash | > > > > | due to unallocated | > > > > | workqueue. | > > > > [snip] > > > > > I have understood that no frames should be received until mac80211 calls > > > struct ieee80211_ops::start: > > > > > > * @start: Called before the first netdevice attached to the hardware > > > * is enabled. This should turn on the hardware and must turn on > > > * frame reception (for possibly enabled monitor interfaces.) > > > > True, but I think he's saying that you can actually add and configure an > > interface as soon as the wiphy is registered? > > With '<---IRQ---(RX packet)' I assumed wcn36xx is delivering a frame to > mac80211 using ieee80211_rx(), but of course I'm just guessing here. Yeah, but that could be legitimate? johannes