From patchwork Tue May 26 06:24:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 6477861 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 715F29F1CC for ; Tue, 26 May 2015 06:25:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F653204D3 for ; Tue, 26 May 2015 06:25:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2A1120495 for ; Tue, 26 May 2015 06:25:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751625AbbEZGYm (ORCPT ); Tue, 26 May 2015 02:24:42 -0400 Received: from helcar.hengli.com.au ([209.40.204.226]:52253 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751612AbbEZGYm (ORCPT ); Tue, 26 May 2015 02:24:42 -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 1Yx8I3-0000P8-Dj; Tue, 26 May 2015 16:24:39 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 4.80) (envelope-from ) id 1Yx8Hx-0001ZR-VS; Tue, 26 May 2015 14:24:34 +0800 Date: Tue, 26 May 2015 14:24:33 +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: <20150526062433.GA6025@gondor.apana.org.au> References: <20150522082708.GA3507@gondor.apana.org.au> <3847514.ujeNcPGtgS@tachyon.chronox.de> <20150525102021.GA30038@gondor.apana.org.au> <3817112.GjAvZ3MSSX@tachyon.chronox.de> <20150525115341.GA30627@gondor.apana.org.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150525115341.GA30627@gondor.apana.org.au> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, May 25, 2015 at 07:53:41PM +0800, Herbert Xu wrote: > On Mon, May 25, 2015 at 01:50:55PM +0200, Stephan Mueller wrote: > > > > When you have my code local, simply execute libkcapi/test/kcapi -y twice or > > three times. That triggered the crash. > > Aha that's what I was missing. I'll look into the crash. OK I forgot to initialise the SG list. This patch fixes it for me. diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c index 1d08483..35556a6 100644 --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c @@ -454,6 +454,7 @@ static int aead_recvmsg(struct socket *sock, struct msghdr *msg, size_t ignored, if (usedpages < outlen) goto unlock; + sg_init_table(dstbuf, ALG_MAX_PAGES + 1); sg_mark_end(sgl->sg + sgl->cur); assoclen = ctx->aead_assoclen; /*