On 5/24/2021 4:48 PM, Sasha Levin wrote:
From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
[ 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.
Regards,
Arend
Cc: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20210503115736.2104747-70-gregkh@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
.../broadcom/brcm80211/brcmfmac/bcmsdh.c | 8 +---
.../broadcom/brcm80211/brcmfmac/bus.h | 19 ++++++++-
.../broadcom/brcm80211/brcmfmac/core.c | 42 ++++++++-----------
.../broadcom/brcm80211/brcmfmac/pcie.c | 9 +---
.../broadcom/brcm80211/brcmfmac/pcie.h | 5 ---
.../broadcom/brcm80211/brcmfmac/usb.c | 4 +-
6 files changed, 41 insertions(+), 46 deletions(-)