Netdev List
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: Benjamin Beichler <Benjamin.Beichler@uni-rostock.de>,
	davem@davemloft.net, johannes@sipsolutions.net,
	kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] mac80211_hwsim: Make hwsim_netgroup IDA
Date: Fri, 2 Mar 2018 14:37:25 +0300	[thread overview]
Message-ID: <5319c18f-ce39-0d4c-e140-50b48b73803f@virtuozzo.com> (raw)
In-Reply-To: <9a826ac0-1354-567b-ec4c-ac8511bf89f6@uni-rostock.de>

On 01.03.2018 20:22, Benjamin Beichler wrote:
> Am 01.03.2018 um 12:30 schrieb Kirill Tkhai:
> 
>> Out of bounds of this patch, just as a report to wireless subsystem
>> maintainer, destroy_radio() increaments hwsim_radios_generation
>> without hwsim_radio_lock, so this may need one more patch to fix.
>>
> The lock is here implicit, because the value only could change at init
> (where netlink callbacks are deactivated and always happens sequential)
> or in netlink callbacks. The only reader of this variable is the dump
> callback, and the only other writers are also netlink callbacks and
> because they are implicitly not parallel (because the parallel flag is
> not set), there could be no race condition. Maybe this should be
> documented somehow, especially if somebody got the idea to allow
> parallel callbacks :-)


static void hwsim_exit_net(...)
{
	...
	INIT_WORK(&data->destroy_work, destroy_radio);
        queue_work(hwsim_wq, &data->destroy_work);
	...
}

destroy_radio() may be executed in parallel with everything above you wrote,
doesn't it? There may be several network namespaces, and destroy_radio()
queued from one net namespace may race with mac80211_hwsim_new_radio()
or hwsim_del_radio_nl() for another net namespace. I don't see, how netlink
locking can act on synchronization with a work. This is what I mention.

Thanks,
Kirill

  reply	other threads:[~2018-03-02 11:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 11:30 [PATCH net-next 0/2] Converting pernet_operations (part #3) (wireless, mac80211_hwsim) Kirill Tkhai
2018-03-01 11:30 ` [PATCH net-next 1/2] mac80211_hwsim: Make hwsim_netgroup IDA Kirill Tkhai
2018-03-01 17:22   ` Benjamin Beichler
2018-03-02 11:37     ` Kirill Tkhai [this message]
2018-03-03  8:01       ` Benjamin Beichler
2018-03-01 11:30 ` [PATCH net-next 2/2] net: Convert hwsim_net_ops Kirill Tkhai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5319c18f-ce39-0d4c-e140-50b48b73803f@virtuozzo.com \
    --to=ktkhai@virtuozzo.com \
    --cc=Benjamin.Beichler@uni-rostock.de \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox