Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3323051ybz; Mon, 4 May 2020 00:18:08 -0700 (PDT) X-Google-Smtp-Source: APiQypJ15SHb0lqVXUzsuioCZkQJngW5FnSPuFIBExSn6eP2LRqw8mM+ZCZJ5fuIduQoM6bMgbSN X-Received: by 2002:a50:c60c:: with SMTP id k12mr13321948edg.111.1588576688816; Mon, 04 May 2020 00:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588576688; cv=none; d=google.com; s=arc-20160816; b=BZXKkU+qoqbwRUTsbJ4H8A2NMxqpH+3yNOsRCb/S4bOXKjCLhLhu2iAzw+cubObKWx gB/y/Eeng8Z2DRg671GXFqtdPt7jrlmF3x0txQpLfPsD/+1SfYmImch1d2WKs/KrZMti 0uslmLHPCSxaOcUgKj34VDRzp2o/e5tsiXbz3wiivBcTcgW9YTDUt5/fzdvx3zM5hSO9 scWLiyRIT6J5lgAVGwy+zj5gOKWhZT+S/wwdjMAgM1IkJcnrlaf+ILUoQayHuBW76HWt cOGdjGoQowBCYhb8ZOrEN8KePOdig9B9jo0LEzRnydV01v4TJiNWxV6ulLuTNDsniXLT HpbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TVkPw9CXSyMNGSUH1MDPHOnQu94I2EH+MjKjCaPPNS8=; b=Nn5fqkXvlufTku+NxDMuc9f+sbkW4XZ1lyz/+uXUH0fx9mGUhNDKj+r760Gw6a3ojY b2pp1Q94g7Rh2EdyAReQ99qILRDKFu6mSE5ULhdzTz0QdO0fJZuqBDD+q6T6YyDNGdsH dLF/LNUp6aBAbW08Z9ifxWed7q0A/gWIMLmVSdrKb4bb1sUirouPT3ZHu0/ODLjm/RKp yArM+0Da6uzhmMgGAXzsZZ28oZyLDZVkWA4kVnsbvvY3LV9ETG5n5SmQ022CzlENCeEy qWZmXaD7O+VM+793ObUWbvDOtcxPu1J69sdCzqNG9kshh4Q5PLtdQ6VJcW5RQJ/TryNY o+jA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si5791448edq.231.2020.05.04.00.17.34; Mon, 04 May 2020 00:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbgEDHQv (ORCPT + 99 others); Mon, 4 May 2020 03:16:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726515AbgEDHQu (ORCPT ); Mon, 4 May 2020 03:16:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E32EC061A0E for ; Mon, 4 May 2020 00:16:50 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVVLI-00028Z-SR; Mon, 04 May 2020 09:16:44 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1jVVLI-0001Mp-3y; Mon, 04 May 2020 09:16:44 +0200 Date: Mon, 4 May 2020 09:16:44 +0200 From: Sascha Hauer To: Eric Biggers Cc: Richard Weinberger , linux-mtd@lists.infradead.org, linux-crypto@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] ubifs: fix wrong use of crypto_shash_descsize() Message-ID: <20200504071644.GS5877@pengutronix.de> References: <20200502055945.1008194-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200502055945.1008194-1-ebiggers@kernel.org> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:12:17 up 74 days, 14:42, 102 users, load average: 0.08, 0.30, 0.31 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, May 01, 2020 at 10:59:45PM -0700, Eric Biggers wrote: > From: Eric Biggers > > crypto_shash_descsize() returns the size of the shash_desc context > needed to compute the hash, not the size of the hash itself. > > crypto_shash_digestsize() would be correct, or alternatively using > c->hash_len and c->hmac_desc_len which already store the correct values. > But actually it's simpler to just use stack arrays, so do that instead. > > Fixes: 49525e5eecca ("ubifs: Add helper functions for authentication support") > Fixes: da8ef65f9573 ("ubifs: Authenticate replayed journal") > Cc: # v4.20+ > Cc: Sascha Hauer > Signed-off-by: Eric Biggers Looks better that way, thanks. Acked-by: Sascha Hauer Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |