[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150515.130219.331336809636676892.davem@redhat.com>
Date: Fri, 15 May 2015 13:02:19 -0400 (EDT)
From: David Miller <davem@...hat.com>
To: herbert@...dor.apana.org.au
Cc: eric.dumazet@...il.com, tgraf@...g.ch, netdev@...r.kernel.org,
ying.xue@...driver.com
Subject: Re: netlink: Kill bogus lock_sock in netlink_insert
From: Herbert Xu <herbert@...dor.apana.org.au>
Date: Thu, 14 May 2015 14:02:30 +0800
> The commit c5adde9468b0714a051eac7f9666f23eb10b61f7 ("netlink:
> eliminate nl_sk_hash_lock") added a lock_sock to netlink_insert
> with no justifications whatsoever.
>
> This patch kills it.
>
> Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
Actually, Herbert, I think this lock_sock() is needed.
Otherwise nothing protects nlk_sk(sk)->portid, upon which we
perform a non-atomic test-and-set operation here.
If you remove the lock_sock(), two parallel bind/inserts are
possible on the same socket, potentially resulting in socket
state corruption.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists