From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326AbbERN00 (ORCPT ); Mon, 18 May 2015 09:26:26 -0400 Received: from mail.eperm.de ([89.247.134.16]:34829 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751089AbbERN0R (ORCPT ); Mon, 18 May 2015 09:26:17 -0400 From: Stephan Mueller To: Herbert Xu Cc: pebolle@tiscali.nl, andreas.steffen@strongswan.org, tytso@mit.edu, sandyinchina@gmail.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v6 1/5] random: Blocking API for accessing nonblocking_pool Date: Mon, 18 May 2015 15:26:13 +0200 Message-ID: <2931045.EGfWxfUOa7@tauon> User-Agent: KMail/4.14.6 (Linux/3.19.5-200.fc21.x86_64; KDE/4.14.6; x86_64; ; ) In-Reply-To: <7743005.ngVOaoViLi@tauon> References: <1921857.OvxEu6y28S@tachyon.chronox.de> <20150518092131.GA18659@gondor.apana.org.au> <7743005.ngVOaoViLi@tauon> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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