Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95BBCC636CD for ; Tue, 7 Feb 2023 08:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230519AbjBGIEe (ORCPT ); Tue, 7 Feb 2023 03:04:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbjBGIEd (ORCPT ); Tue, 7 Feb 2023 03:04:33 -0500 Received: from formenos.hmeau.com (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 079BD13508; Tue, 7 Feb 2023 00:04:29 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pPIxE-008OMQ-SI; Tue, 07 Feb 2023 16:03:53 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 07 Feb 2023 16:03:52 +0800 Date: Tue, 7 Feb 2023 16:03:52 +0800 From: Herbert Xu To: Jakub Kicinski Cc: Linux Crypto Mailing List , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, "David S. Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, Tyler Hicks , ecryptfs@vger.kernel.org, Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, Steffen Klassert , Jon Maloy , Ying Xue , Boris Pismenny , John Fastabend , David Howells , Jarkko Sakkinen , keyrings@vger.kernel.org Subject: Re: [PATCH 0/17] crypto: api - Change completion callback argument to void star Message-ID: References: <20230206231008.64c822c1@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230206231008.64c822c1@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Mon, Feb 06, 2023 at 11:10:08PM -0800, Jakub Kicinski wrote: > On Mon, 6 Feb 2023 18:21:06 +0800 Herbert Xu wrote: > > The crypto completion function currently takes a pointer to a > > struct crypto_async_request object. However, in reality the API > > does not allow the use of any part of the object apart from the > > data field. For example, ahash/shash will create a fake object > > on the stack to pass along a different data field. > > "different data field" == copy the value to a different structure? > A bit hard to parse TBH. The word data here refers to the data field in struct crypto_async_request. > Buggy means bug could be hit in real light or buggy == did not use > the API right? Yes this bug is real. If you hit a driver/algorithm that returns a different request object (of which there are many in the API) then you will be dereferencing random pointers. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt