From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752620AbdLKLxB (ORCPT ); Mon, 11 Dec 2017 06:53:01 -0500 Received: from [128.1.224.119] ([128.1.224.119]:44012 "EHLO ringil.hmeau.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752609AbdLKLxA (ORCPT ); Mon, 11 Dec 2017 06:53:00 -0500 Date: Mon, 11 Dec 2017 22:52:26 +1100 From: Herbert Xu To: Stephan =?iso-8859-1?Q?M=FCller?= Cc: syzbot , davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH] crypto: AF_ALG - fix race accessing cipher request Message-ID: <20171211115226.GM12014@gondor.apana.org.au> References: <001a1141f050d78763055f85c42e@google.com> <5543369.6UIL7PonCy@positron.chronox.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5543369.6UIL7PonCy@positron.chronox.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 08, 2017 at 11:50:37AM +0100, Stephan Müller wrote: > Hi Herbert, > > This patch would go on top of 7d2c3f54e6f646887d019faa45f35d6fe9fe82ce > "crypto: af_alg - remove locking in async callback" found in Linus' tree > which is not yet in the cryptodev-2.6 tree. > > In addition, this patch is already on top of the other patches discussed > on this list fixing similar issues. I.e. depending in which order you apply > the patches, there may be a hunk. In case you want me to rebase the patch, > please let me know. > > ---8<--- > When invoking an asynchronous cipher operation, the invocation of the > callback may be performed before the subsequent operations in the > initial code path are invoked. The callback deletes the cipher request > data structure which implies that after the invocation of the > asynchronous cipher operation, this data structure must not be accessed > any more. > > The setting of the return code size with the request data structure must > therefore be moved before the invocation of the asynchronous cipher > operation. > > Fixes: e870456d8e7c ("crypto: algif_skcipher - overhaul memory management") > Fixes: d887c52d6ae4 ("crypto: algif_aead - overhaul memory management") > Reported-by: syzbot > Cc: # v4.14+ > Signed-off-by: Stephan Mueller Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt