Re: [PATCH 1/3] net: Fix possible race in peernet2id_alloc()

2017-12-28 Thread David Miller
From: Kirill Tkhai Date: Thu, 28 Dec 2017 15:55:15 +0300 > Could you please clarify the status or what I should do with the patchset > (because it's not clear for me)? Please resend.

Re: [PATCH 1/3] net: Fix possible race in peernet2id_alloc()

2017-12-28 Thread Kirill Tkhai
Hi, David, I see the status of patchset has changed on https://patchwork.ozlabs.org/patch/851928/ and now it is "Changes Requested". There was Eric's reply, and my reply on his message. After that there wasn't objections on my reply or other patches. Could you please clarify the status or what

Re: [PATCH 1/3] net: Fix possible race in peernet2id_alloc()

2017-12-22 Thread Kirill Tkhai
Hi, Eric, On 21.12.2017 20:39, Eric W. Biederman wrote: > Kirill Tkhai writes: > >> peernet2id_alloc() is racy without rtnl_lock() as atomic_read(&peer->count) >> under net->nsid_lock does not guarantee, peer is alive: >> >> rcu_read_lock() >> peernet2id_alloc().. >>

Re: [PATCH 1/3] net: Fix possible race in peernet2id_alloc()

2017-12-21 Thread Eric W. Biederman
Kirill Tkhai writes: > peernet2id_alloc() is racy without rtnl_lock() as atomic_read(&peer->count) > under net->nsid_lock does not guarantee, peer is alive: > > rcu_read_lock() > peernet2id_alloc().. > spin_lock_bh(&net->nsid_lock) .. > atomic_read(&p

[PATCH 1/3] net: Fix possible race in peernet2id_alloc()

2017-12-21 Thread Kirill Tkhai
peernet2id_alloc() is racy without rtnl_lock() as atomic_read(&peer->count) under net->nsid_lock does not guarantee, peer is alive: rcu_read_lock() peernet2id_alloc().. spin_lock_bh(&net->nsid_lock) .. atomic_read(&peer->count) == 1 .. .