Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp135816imm; Fri, 5 Oct 2018 00:54:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Nk0BX8HRAj4ylLhpNcr20SOO8lm1j2YmGYFzYjZz0PzrY79cMd+sBiO07zS3z5q7aVKJJ X-Received: by 2002:a17:902:b947:: with SMTP id h7-v6mr10267563pls.231.1538726069516; Fri, 05 Oct 2018 00:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538726069; cv=none; d=google.com; s=arc-20160816; b=AfXbfCg+Yvnl7cP2zHnSFxL2SVCtcF+5bfbOfmOGNo2vUTXdaZ4XIqaa1NpynixEwv rc/jAsYsGwkMMJN7Y9kABpTbb93afwQbE9xTYGwsZokgi7fLcTukd8HjpNtNrq5orymg Y8HM8e8llUZwvBQybCPY2V5Lh2dXMwLbP7Q8QkCFlClyPD/u86Y9QxkDmUdgw8YEVgkN DK0Eijei+zcGrWm+iI6B/wwxDOJIcNfikSSXfEDqF8Gjcz3s8yduCVi7PLp3INCN1BXm cHllxBRZNLLHSKZRhSJSAHcuYjBQ/I6ywgHPxbD3oUCWz8XOtq1TeM8MSRKvGXBMkTsM Dl9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QwgsHAszBPD7aYffAK4EBjjLDlDQRqbBTE2nn4mnTjY=; b=Ymdmdp685V9cGrBmT1aPpfBiwXiKC9y5QPSBxujRvKdZKCjq/dFNY+kiaoZ0o4bAdg fCKp2s6WbygXHInmpg0o1Cc1f0OnBjU2GaW0rTdOZ6jSnAcfbTY9C5/YQloB6tR30uT3 W7bVaW7+A2w6+qBZeZOSaW2wEMSmRrSAIhX1n4kLeXaPBprLYXmrpH9GfZzHpddCOzOS XUGK0B6/ruv6HqiTGhWdQnFvGwRQATLXxar2DbRs4TIVTuHtwVTqiI3iPgCVeBQq9Qn3 3/EvOaTprErJ1IOA2vX+XH0gghObI647uRBgQvyKNQoRWIskD/+Gz2g3CaZC3ftxHvdm pdvw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si8034423pfd.66.2018.10.05.00.54.12; Fri, 05 Oct 2018 00:54:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727802AbeJEOvi (ORCPT + 99 others); Fri, 5 Oct 2018 10:51:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbeJEOvi (ORCPT ); Fri, 5 Oct 2018 10:51:38 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C96FE30B8F97; Fri, 5 Oct 2018 07:54:06 +0000 (UTC) Received: from localhost (unknown [10.43.2.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F8BF3002615; Fri, 5 Oct 2018 07:54:04 +0000 (UTC) Date: Fri, 5 Oct 2018 09:54:04 +0200 From: Stanislaw Gruszka To: Jia-Ju Bai Cc: kvalo@codeaurora.org, davem@davemloft.net, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: wireless: iwlegacy: Fix possible data races in il4965_send_rxon_assoc() Message-ID: <20181005075403.GC1931@redhat.com> References: <20181003140745.7650-1-baijiaju1990@gmail.com> <20181004075914.GB20523@redhat.com> <988494cb-c121-697e-b502-ea4e7c601f47@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <988494cb-c121-697e-b502-ea4e7c601f47@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 05 Oct 2018 07:54:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 04, 2018 at 04:52:19PM +0800, Jia-Ju Bai wrote: > On 2018/10/4 15:59, Stanislaw Gruszka wrote: > >On Wed, Oct 03, 2018 at 10:07:45PM +0800, Jia-Ju Bai wrote: > >>These possible races are detected by a runtime testing. > >>To fix these races, the mutex lock is used in il4965_send_rxon_assoc() > >>to protect the data. > >Really ? I'm surprised by that, see below. > > My runtime testing shows that il4965_send_rxon_assoc() and > il4965_configure_filter() are concurrently executed. > But after seeing your reply, I need to carefully check whether my > runtime testing is right, because I think you are right. > In fact, I only monitored the iwl4965 driver, but did not monitor > the iwlegacy driver, so I will do the testing again with monitoring > the lwlegacy driver. > >So I wonder how this patch did not cause the deadlock ? > > Oh, sorry, anyway, my patch will cause double locks... So how those runtime test were performend such you didn't notice this ? > >Anyway what can be done is adding: > > > >lockdep_assert_held(&il->mutex); > > > >il4965_commit_rxon() to check if we hold the mutex. > > I agree. Care to post a patch ? Thanks Stanislaw