From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51DB0C433ED for ; Fri, 21 May 2021 07:58:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16140613B6 for ; Fri, 21 May 2021 07:58:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16140613B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gondor.apana.org.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bJwa4mMU1j4Pvm9w4PEdb8AM3LL+n1OPGwbvuA0D0vU=; b=fgdNeQ2Alg2t54SbxJ629hMdmj MptjcIVMBOZ5UyHALElVEBtiDRvBCW/On5OlWI3H6S1rKdPsNVa541n81Fp4SwuU9+eB9uMje62UK K8Hiu9E1xVf3wAlySRy0VF+4JPkya5XJTcV+vy9dm025sxbivYLiJbwwe2uzikqz97umkDjx0+5Tb Vdu4Q+D5LyPxl/DOBC/pSDD6eXRs1PIQvKl79OIxjRwQMWFJN9XIEpHJuJKWBZri8sf6dibjvx8sx WSIJndqtvRrMueKIINlGrfEmPpHSoLHeO7qBLhW72GErGMGpmZEMiiiAq3rzQUTWeOqNCZXOWOhd1 Z28T8jrA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk00m-004JH8-QN; Fri, 21 May 2021 07:56:01 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk00i-004JFN-NP for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 07:55:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kqDK15rc+u+68Ye5ezOSZJKqTbbkjSxOKE1TSfTL1gw=; b=CyGxjhEwOnCxSbs/u4yMd6X8iY UZnvM8yMTSV9qmqFBPDYTBJOCqvLQgE7oX3N7W1JkmeTonNbmlq2vE/ZpIphHoa8UT0GzWyYO7nuS PV+oqnmmBLzWejpvZGAiZBK0PNp5a01bQBDT44WGLztpwwLPUpJIUE681x6QSUj6IfkmggRFaHgr9 FOpeNBKeF1jCXdy6+Q28sgMS/eblGILMV5Nth8Vl8S89RClCMHYglnDzOXgs6RJynTDaRfHXCj5Rj Y9TZ5g3kOmTGrjJv59Oq0eTGBt8pXOhegiVQXbLyYao5d1UoghxrBFaPE/OlEGTwYxdmWL8nJobYO RuxXUu4Q==; Received: from helcar.hmeau.com ([216.24.177.18] helo=deadmen.hmeau.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lk00e-00GvNJ-OH for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 07:55:54 +0000 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.92 #5 (Debian)) id 1lk00a-0004WP-00; Fri, 21 May 2021 15:55:48 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1lk00W-0005qv-MY; Fri, 21 May 2021 15:55:44 +0800 Date: Fri, 21 May 2021 15:55:44 +0800 From: Herbert Xu To: Ard Biesheuvel Cc: Eric Biggers , Linux Crypto Mailing List , Linux ARM , Will Deacon , Android Kernel Team Subject: Re: [PATCH v3 1/7] crypto: handle zero sized AEAD inputs correctly Message-ID: <20210521075544.kywxswbfyoauvhmg@gondor.apana.org.au> References: <20210512184439.8778-1-ardb@kernel.org> <20210512184439.8778-2-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_005552_806327_689EF450 X-CRM114-Status: GOOD ( 11.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 12, 2021 at 11:24:09PM +0200, Ard Biesheuvel wrote: > > The difference is that zero sized inputs never make sense for > skciphers, but for AEADs, they could occur, even if they are uncommon > (the AEAD could have associated data only, and no plain/ciphertext) I don't see what a zero-sized input has to do with this though. When the walk->nbytes is zero, that means that you must never call the done function, because the walk state could be in error in which case everything would have been freed already and calling the done function may potentially cause a double-free. I don't understand why in the case of AEAD you cannot structure your code such that the done function is not called when nbytes is zero. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel