From mboxrd@z Thu Jan 1 00:00:00 1970 From: Herbert Xu Subject: Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc) Date: Wed, 22 Jun 2016 08:42:14 +0800 Message-ID: <20160622004214.GA27134@gondor.apana.org.au> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Johan Hedberg , Gustavo Padovan , Marcel Holtmann , linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "David S. Miller" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Linus Torvalds To: Andy Lutomirski Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-crypto.vger.kernel.org On Tue, Jun 21, 2016 at 10:43:40AM -0700, Andy Lutomirski wrote: > > Is there a straightforward way that bluetooth and, potentially, other > drivers can just do synchronous crypto in a small buffer specified by > its virtual address? The actual cryptography part of the crypto code > already works this way, but I can't find an API for it. Yes, single block users should use crypto_cipher_encrypt_one, an example would be drivers/md/dm-crypt.c. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751735AbcFVBEE (ORCPT ); Tue, 21 Jun 2016 21:04:04 -0400 Received: from helcar.hengli.com.au ([209.40.204.226]:51436 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbcFVBEC (ORCPT ); Tue, 21 Jun 2016 21:04:02 -0400 Date: Wed, 22 Jun 2016 08:42:14 +0800 From: Herbert Xu To: Andy Lutomirski Cc: linux-bluetooth@vger.kernel.org, Johan Hedberg , Gustavo Padovan , Marcel Holtmann , linux-crypto@vger.kernel.org, "David S. Miller" , "linux-kernel@vger.kernel.org" , Linus Torvalds Subject: Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc) Message-ID: <20160622004214.GA27134@gondor.apana.org.au> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Jun 21, 2016 at 10:43:40AM -0700, Andy Lutomirski wrote: > > Is there a straightforward way that bluetooth and, potentially, other > drivers can just do synchronous crypto in a small buffer specified by > its virtual address? The actual cryptography part of the crypto code > already works this way, but I can't find an API for it. Yes, single block users should use crypto_cipher_encrypt_one, an example would be drivers/md/dm-crypt.c. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt