lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220530101634.GJ1615@pengutronix.de>
Date:   Mon, 30 May 2022 12:16:34 +0200
From:   Sascha Hauer <s.hauer@...gutronix.de>
To:     Kalle Valo <kvalo@...nel.org>
Cc:     Ping-Ke Shih <pkshih@...ltek.com>,
        Hans Ulli Kroll <linux@...i-kroll.de>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
        Yan-Hsuan Chuang <tony0620emma@...il.com>,
        linux-kernel@...r.kernel.org, Neo Jou <neojou@...il.com>,
        kernel@...gutronix.de, Johannes Berg <johannes@...solutions.net>
Subject: Re: [PATCH 00/10] RTW88: Add support for USB variants

On Mon, May 30, 2022 at 01:07:25PM +0300, Kalle Valo wrote:
> Sascha Hauer <s.hauer@...gutronix.de> writes:
> 
> > On Mon, May 30, 2022 at 12:25:13PM +0300, Kalle Valo wrote:
> >> Sascha Hauer <s.hauer@...gutronix.de> writes:
> >> 
> >> > Another problem to address is that the driver uses
> >> > ieee80211_iterate_stations_atomic() and
> >> > ieee80211_iterate_active_interfaces_atomic() and does register accesses
> >> > in the iterator. This doesn't work with USB, so iteration is done in two
> >> > steps now: The ieee80211_iterate_*_atomic() functions are only used to
> >> > collect the stations/interfaces on a list which is then iterated over
> >> > non-atomically in the second step. The implementation for this is
> >> > basically the one suggested by Ping-Ke here:
> >> >
> >> > https://lore.kernel.org/lkml/423f474e15c948eda4db5bc9a50fd391@realtek.com/
> >> 
> >> Isn't this racy? What guarantees that vifs are not deleted after
> >> ieee80211_iterate_active_interfaces_atomic() call?
> >
> > The driver mutex &rtwdev->mutex is acquired during the whole
> > collection/iteration process. For deleting an interface
> > ieee80211_ops::remove_interface would have to be called, right?
> > That would acquire &rtwdev->mutex as well, so I think this should be
> > safe.
> 
> Can you add a comment to the code explaining this?

Sure.

> And
> lockdep_assert_held() is a good way to guarantee that the mutex is
> really held.

Yes, Ping-Ke already pointed that out. Will add in the next round.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ