From patchwork Sun May 24 03:34:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 475942 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7DE731402BA for ; Sun, 24 May 2015 13:34:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755127AbbEXDe3 (ORCPT ); Sat, 23 May 2015 23:34:29 -0400 Received: from helcar.hengli.com.au ([209.40.204.226]:60609 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966AbbEXDe2 (ORCPT ); Sat, 23 May 2015 23:34:28 -0400 Received: from gondolin.me.apana.org.au ([192.168.0.6]) by norbury.hengli.com.au with esmtp (Exim 4.80 #3 (Debian)) id 1YwMgD-0004PD-PO; Sun, 24 May 2015 13:34:25 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 4.80) (envelope-from ) id 1YwMg9-0005OJ-29; Sun, 24 May 2015 11:34:21 +0800 Date: Sun, 24 May 2015 11:34:20 +0800 From: Herbert Xu To: Stephan Mueller Cc: Linux Crypto Mailing List , netdev@vger.kernel.org, "David S. Miller" , Johannes Berg , Marcel Holtmann , Steffen Klassert Subject: Re: [v2 PATCH 13/13] crypto: algif_aead - Switch to new AEAD interface Message-ID: <20150524033420.GC20656@gondor.apana.org.au> References: <20150522082708.GA3507@gondor.apana.org.au> <1969904.xZlo35YxmK@tachyon.chronox.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1969904.xZlo35YxmK@tachyon.chronox.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, May 23, 2015 at 08:04:19PM +0200, Stephan Mueller wrote: > Am Freitag, 22. Mai 2015, 16:31:04 schrieb Herbert Xu: > > Hi Herbert, > > > This patch makes use of the new AEAD interface which uses a single > > SG list instead of separate lists for the AD and plain text. > > After applying your additional patch, the "normal" AEAD operation works. > > But with long messages (16 filled pages), I get the following. To test, simply > use [1], cd libkcapi/test, compile and execute ./kcapi -y Thanks for testing! Does this patch help? Cheers, diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c index a483a6f..1d08483 100644 --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c @@ -494,11 +494,11 @@ static int aead_recvmsg(struct socket *sock, struct msghdr *msg, size_t ignored, else if (outlen) /* AD size is non-zero */ scatterwalk_crypto_chain( - dst, ctx->rsgl[0].sg, + dst + i - 1, ctx->rsgl[0].sg, sg_page(ctx->rsgl[0].sg) == sg_page(dst + i - 1) && ctx->rsgl[0].sg[0].offset == dst[i - 1].offset + dst[i - 1].length, - i + 1); + 2); else /* AD only */ sg_mark_end(dst + i);