OpenVZ Forum


Home » Mailing lists » Devel » [PATCH (resubmit)] Fix inet_diag.ko register vs rcv race
Re: [PATCH (resubmit)] Fix inet_diag.ko register vs rcv race [message #24207 is a reply to message #24199] Mon, 03 December 2007 09:01 Go to previous message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
Herbert Xu wrote:
> On Thu, Nov 29, 2007 at 04:01:25PM +0300, Pavel Emelyanov wrote:
>> @@ -863,13 +861,13 @@ int inet_diag_register(const struct inet_diag_handler *h)
>>  	if (type >= INET_DIAG_GETSOCK_MAX)
>>  		goto out;
>>  
>> -	spin_lock(&inet_diag_register_lock);
>> +	mutex_lock(&inet_diag_mutex);
>>  	err = -EEXIST;
>>  	if (inet_diag_table[type] == NULL) {
>>  		inet_diag_table[type] = h;
>>  		err = 0;
>>  	}
>> -	spin_unlock(&inet_diag_register_lock);
>> +	mutex_unlock(&inet_diag_mutex);
> 
> Actually this causes a dead-lock when the handlers are built as modules
> because we try to load them with that mutex held.

Ouch! Sorry, I didn't notice this :(

> I've fixed it with this patch on top.

Thanks!

> Cheers,

Pavel
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: namespace support requires network modules to say "GPL"
Next Topic: [PATCH] Avoid potential NULL dereference in unregister_sysctl_table
Goto Forum:
  


Current Time: Fri Jan 02 07:45:31 GMT 2026

Total time taken to generate the page: 0.48209 seconds