From: Andy Lutomirski Subject: Re: Doing crypto in small stack buffers (bluetooth vs vmalloc-stack crash, etc) Date: Tue, 21 Jun 2016 17:52:23 -0700 Message-ID: References: <20160622004214.GA27134@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Andy Lutomirski , 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 To: Herbert Xu Return-path: Received: from mail-vk0-f46.google.com ([209.85.213.46]:36093 "EHLO mail-vk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbcFVA6A (ORCPT ); Tue, 21 Jun 2016 20:58:00 -0400 Received: by mail-vk0-f46.google.com with SMTP id u64so42850908vkf.3 for ; Tue, 21 Jun 2016 17:58:00 -0700 (PDT) In-Reply-To: <20160622004214.GA27134@gondor.apana.org.au> Sender: linux-crypto-owner@vger.kernel.org List-ID: On Tue, Jun 21, 2016 at 5:42 PM, Herbert Xu wrote: > 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. > Aha! I expected something like that to exist, but I couldn't find it. I'll change the two offenders I've found so far to use it. --Andy