Re: [PATCH v6 1/5] random: Blocking API for accessing nonblocking_pool

Stephan Mueller
2015-05-18T13:26:26Z

Am Montag, 18. Mai 2015, 15:07:10 schrieb Stephan Mueller:

Hi Herbert,

>>
>>You can simplify this further and get rid of buf/nbytes. All
>>we need to know is whether the pool is ready. Everything else
>>can come from private.
>
>So, the async function is now just a notification of the caller. Sounds good
>with me.
>

I am just running into an interesting problem with a missing cancel operation:
a caller instantiates a DRBG handle and invokes the seeding operation. The
nonblocking_pool is not initialized. Therefore, the callback is put onto the
list for being processed later.

Now, the caller releases the DRBG handle *before* the callback is triggered.

The callback is triggered with a pointer that is invalid, but the pointer is
non-NULL. Therefore, I am not sure how to validate the pointer in the callback
function.

I would think that there is no other way than to add a cancel API call that
allows removing a list entry from the wait list.

Ciao
Stephan