[openib-general] Re: [PATCH] cm refcount race fix

Sean Hefty sean.hefty at intel.com
Mon May 8 19:49:07 PDT 2006


>If you wanted to implement this, you would have to use a completion.
>A mutex can't be used because it must be released in process context
>with interrupts enabled.  And a semaphore can't be used because
>there's an implicit use-after-free with semaphores (basically up()
>touches the semaphore memory after it calls wake_up()).

Ah, I was looking around the kernel include files for some sort of signaled
event.  A completion looks like it's exactly what we want.  Would replacing
wake_up() with complete() and wait_event() with wait_for_completion() work?

- Sean



More information about the general mailing list