Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4091441pxj; Mon, 24 May 2021 23:44:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9YMkpwdb0MzWTKcxqASc8JscNP8ODAXn/D9p3auDGw3iTjl9Vb1cUwPXV95gSydDczNPy X-Received: by 2002:a17:906:9159:: with SMTP id y25mr26975910ejw.144.1621925085860; Mon, 24 May 2021 23:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621925085; cv=none; d=google.com; s=arc-20160816; b=upMtWppcsN1DtfUPe4yvpp2gf0sXdRXOLEtUSOQS93W1HP2+bKl/Z+iwbS/N9JhLsw A1IIwXUg50LJfSE4ulKLDyh/+MMxocBNsC4MQIz1FB8aO5DOtxClxtONiRFWdcNV7L8N IUQyfDNq7sy1kYVzj3Rc0gCdlTR+MP6IgmQfI8KRZPHv4MtEcCT7b5Ry1XxMEig6sOdT Gy+zes48gh8kU3WhEX6YMdvV+fjQJ2NSz0LVFTTS8pT4yWz4UgpViRUc5CjrZ53ISGZA kA5iGWKXrG76adl41KgfdTzZdWpiRPbRN+tIy2ecWh2vYY+cp4jZURJNvB5eXYZoamUy JmYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LhMEhlsQrYbw+shNvBhXwjobYEYoaM+kLRCiUau6zyg=; b=DCRTHSa+1vvZ6rf10KW67NxE61c4uYuw85YsaFRqrwdEQTTY4AH0gPi26OY8VVrXh8 bdOxm53tnD2T86U3a2xVaDMxZRScTe4KIEY+LRbZLiVwU1SceHyc7wDjymvZKpCa8ZmF zpAdjLIYJAFTdPjx4Yh/HSI6NCr3YrNJjBSNuBMLtrfq/ODZ7GOLilhKHuWBGXU4sq2G jGwAMrKi+RV5jPkNTeB3kF31BVvUhLEJZt3Pb0sM0/x6nD7j2TsR6LBjNShlYRHaGnmc ANefnnLsj+p8UnUy18k3g1hacEnfnG9xbB29QXg6l+V+gj63cHf+cdygQwk0EaNgaHSv atYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nzgQ+hah; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h16si16155361edv.607.2021.05.24.23.44.23; Mon, 24 May 2021 23:44:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nzgQ+hah; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231296AbhEYGor (ORCPT + 99 others); Tue, 25 May 2021 02:44:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:50014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbhEYGoq (ORCPT ); Tue, 25 May 2021 02:44:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3EAF613F9; Tue, 25 May 2021 06:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621924997; bh=SeNCHGkpDuqd+vKkt1qvz/en9DP7w5H/Z05UvYiBdNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nzgQ+hahb5CsVq/6nxMIencVK8TBF49dn8AAHRnwKkS4hC9HlAaI+q26ZjCMvQtVS +Cg45bKaT+Efr0kAdAWU+YsaEZQnG4Vr8SkeidGWKLzC87QXUEmVH2oRlys8OxMTsN 04x2WYo+HGUcAXJJbfrZxDT69WIOIBkMTtWah2PI= Date: Tue, 25 May 2021 08:43:14 +0200 From: Greg Kroah-Hartman To: Arend van Spriel Cc: linux-wireless , Kalle Valo , Sasha Levin Subject: Re: [PATCH AUTOSEL 5.4 39/52] brcmfmac: properly check for bus register errors Message-ID: References: <20210524144903.2498518-1-sashal@kernel.org> <20210524144903.2498518-39-sashal@kernel.org> <437445ee-a360-597f-f058-3b913984e064@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <437445ee-a360-597f-f058-3b913984e064@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, May 25, 2021 at 08:38:34AM +0200, Arend van Spriel wrote: > On 5/24/2021 4:48 PM, Sasha Levin wrote: > > From: Greg Kroah-Hartman > > > > [ Upstream commit 419b4a142a7ece36cebcd434f8ce2af59ef94b85 ] > > > > The brcmfmac driver ignores any errors on initialization with the > > different busses by deferring the initialization to a workqueue and > > ignoring all possible errors that might happen. Fix up all of this by > > only allowing the module to load if all bus registering worked properly. > > Hi Greg, > > Saw this one flying by for stable kernel. Actually the first time I saw this > patch, because I don't follow LKML as much as linux-wireless. The patch is > fine, but wanted to give some context on the workqueue approach. It was > there for historic reasons. Back then we had the UMH to provide firmware > loading and because we request firmware during driver probe we could cause > kernel boot to show significant delay when driver was built-in. Hence the > workqueue which allowed kernel boot to proceed and driver probe was running > in another thread context. These days we have direct firmware loading from > the kernel and brcmfmac uses the asynchronous firmware loading API so there > is indeed no longer a need for the workqueue. > > Just for my understanding could you explain the motivation behind this > change. In the preceding revert patch I saw this remark: > > """ > The original commit here did nothing to actually help if usb_register() > failed, so it gives a "false sense of security" when there is none. The > correct solution is to correctly unwind from this error. > """ > > Does this mean the patch is addressing some security issue. Before your > patch the module would remain loaded despite a bus register failure. I guess > there is a story behind this that I am curious about. The module would remain loaded, yes, but nothing would work, and so no one would have any idea that something went wrong. The original commit was wrong, it did not actually solve anything. This commit properly propagates any error that happens back to the user, like any other module being loaded. thanks, greg k-h