On Thu, 2016-10-20 at 18:12 -0700, Cong Wang wrote: > If this is the cause of the hashlist corruption (I am still unsure about > this), > then why only UDP? Don't all of those using ip4_datagram_connect() > as ->connect() and using udp_disconnect() as ->disconnect() need this fix? > > For example, after your patch, > > .connect = ip4_datagram_connect, > - .disconnect = udp_disconnect, > + .disconnect = __udp_disconnect, > > Ping socket still doesn't have sock lock for ->disconnect() but has it for > ->connect()? I must miss something...
ping is less complex, it is protected by a single ping_table.lock While UDP has to maintain two hash chains with may locks, and has to handle rehash(), because autobind happens before full 4-tuple is setup.