[openib-general] [PATCH] for 2-6-19 rdma/addr: use client registration to fix module unload race

Or Gerlitz ogerlitz at voltaire.com
Tue Oct 31 02:26:22 PST 2006


Michael S. Tsirkin wrote:
> Quoting r. Sean Hefty <sean.hefty at intel.com>:
>> Subject: [PATCH] for 2-6-19 rdma/addr: use client registration to fix module unload race
>> Require registration with ib_addr module to prevent caller from unloading
>> while a callback is in progress.

> ib_cm has this bug as well. Shouldn't we patch it for 2.6.19 too?

I know there was a similar discussion which i was not tracking... re 
registrations with the ib_sa module, however, please tell me if and why 
i am wrong:

The kernel is a trusted environment, and hence a kernel consumer module 
willing to unload itself while holding references such as id for which a 
callback into this module is associated, breaks this assumption so it is 
buggy, and need to be fixed.

For example what happens if a module opens a socket in the kernel and 
overrides the net stack callbacks for this socket (data-in, 
ready-to-send) with callbacks of its own (iscsi_tcp does that) and then 
unloads with this socket being open? my understanding is that the system 
    would experience a crash. Same for scsi callbacks etc.

My thinking that the only place where you must follow refrences and 
cleanup is while working with user space, so the rdma_ucm must clean 
addr/sa/cm IDs of processes who exit without cleaning (and uverbs must 
clean hca resources such as pd/mr/qp/ah etc).

Or.





More information about the general mailing list