Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1654799

Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in b43legacy_op_bss_info_changed

From Kalle Valo <kvalo@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in b43legacy_op_bss_info_changed
Date 2017-06-01 06:30 +0200
Message-ID <tNpUd-6bQ-5@gated-at.bofh.it> (permalink)
References <tN8JI-3mG-9@gated-at.bofh.it> <tN934-3sV-17@gated-at.bofh.it> <tNdT4-6EZ-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Michael Büsch <m@bues.ch> writes:

>> > --- a/drivers/net/wireless/broadcom/b43legacy/main.c
>> > +++ b/drivers/net/wireless/broadcom/b43legacy/main.c
>> > @@ -2859,7 +2859,9 @@ static void b43legacy_op_bss_info_changed(struct ieee80211_hw *hw,
>> >  	b43legacy_write32(dev, B43legacy_MMIO_GEN_IRQ_MASK, 0);
>> >  
>> >  	if (changed & BSS_CHANGED_BSSID) {
>> > +		spin_unlock_irqrestore(&wl->irq_lock, flags);
>> >  		b43legacy_synchronize_irq(dev);
>> > +		spin_lock_irqsave(&wl->irq_lock, flags);  
>> 
>> To me this looks like a fragile workaround and not a real fix. You can
>> easily add new race conditions with releasing the lock like this.
>> 
>
>
> I think releasing the lock possibly is fine. It certainly is better than
> sleeping with a lock held.

Sure, but IMHO in general I think the practise of releasing the lock
like this in a middle of function is dangerous as one can easily miss
that upper and lower halves of the function are not actually atomic
anymore. And in this case that it's under a conditional makes it even
worse.

-- 
Kalle Valo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] b43legacy: Fix a sleep-in-atomic bug in b43legacy_op_bss_info_changed Jia-Ju Bai <baijiaju1990@163.com> - 2017-05-31 12:10 +0200
  Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in b43legacy_op_bss_info_changed Kalle Valo <kvalo@codeaurora.org> - 2017-05-31 12:30 +0200
    Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in  b43legacy_op_bss_info_changed Arend van Spriel <arend.vanspriel@broadcom.com> - 2017-05-31 14:20 +0200
    Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in  b43legacy_op_bss_info_changed Michael Büsch <m@bues.ch> - 2017-05-31 17:40 +0200
      Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in  b43legacy_op_bss_info_changed Larry Finger <Larry.Finger@lwfinger.net> - 2017-06-01 02:10 +0200
        Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in b43legacy_op_bss_info_changed Jia-Ju Bai <baijiaju1990@163.com> - 2017-06-01 03:10 +0200
        Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in  b43legacy_op_bss_info_changed Michael Büsch <m@bues.ch> - 2017-06-01 07:40 +0200
      Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in b43legacy_op_bss_info_changed Kalle Valo <kvalo@codeaurora.org> - 2017-06-01 06:30 +0200
        Re: [PATCH] b43legacy: Fix a sleep-in-atomic bug in  b43legacy_op_bss_info_changed Michael Büsch <m@bues.ch> - 2017-06-01 07:30 +0200

csiph-web