Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp799167ybk; Fri, 15 May 2020 13:59:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGxCXOsFkkfjY/XC/UvKKOjksV8CUciuVD643mjIJJ3fwwUU08gk0SefB+VMM9zcTokzTJ X-Received: by 2002:a50:f610:: with SMTP id c16mr4828663edn.175.1589576364985; Fri, 15 May 2020 13:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589576364; cv=none; d=google.com; s=arc-20160816; b=iAtkMa2z9UgKvs5xIaRZVUZ/pgxyK7kyAWA6TSd4VJsHTD6BUgFOMZSHLHP7LTCHFm UHLXn5cOtQK00cKbyIOYnO6EAlaS70K/T8MwON4Xr6oIGudgVq8/1sS2zQUnb2c4b1YJ B4MNxYiAMJNsOYSI8OmHdzBFUTX/VxEmACQ8bBVL6vRwlIVhm+3h4ELfc2j2C3R7lulO CEhyka0yM48WzhbjJEGn3AQnJGzIkp6y0MnWrBSe/ZTTHeXYAGyutbOJM3ncTSwaYejb KZy38viXhbF/qypD5irnxY6rSTm2AvQpTuyNqwgl64PAketP/lJGAvg9/meoARnNuFwR 1CAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=H8yathS0B58g4ObaWBD4titGiKmKwmB2WTUXObfzktc=; b=mInUzFaNlhvR4LL0QRZhL3Iru1dVe+4T5xaEYOWmQ0G/MoX0n6luT75EPfuwrEIVee vsW+zQOh5ufDSmgjjNsM9VJgjq1ZI0Kzy2wULpyHAqYx7rv5iZP9AoEfdB89EiJJgRIZ UDleEr5QBX/3ljcmS0qMbeTw9M2XB1ZmW0mRHoxOyHuO/ffka22rZaNLyflHojgBnE+2 Y+prFdI0HDdaI0ImBvUcYqAdjJqhxRAkhBqVQXx1LCZDQcT9oYFTiytjY1uGBQszrmxL O511eVbBMZCiw4FwYEJgi3PssOULzRFvOT4/yofc3udHf5ZK6wEy8yXGvfCv4y7QQfKj 7law== 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 q27si2009447eja.131.2020.05.15.13.59.01; Fri, 15 May 2020 13:59:24 -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 S1726226AbgEOU7A convert rfc822-to-8bit (ORCPT + 99 others); Fri, 15 May 2020 16:59:00 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:35322 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726188AbgEOU7A (ORCPT ); Fri, 15 May 2020 16:59:00 -0400 X-Greylist: delayed 522 seconds by postgrey-1.27 at vger.kernel.org; Fri, 15 May 2020 16:58:58 EDT Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 9190D6224FDF; Fri, 15 May 2020 22:50:15 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id AdrSYIIR5X19; Fri, 15 May 2020 22:50:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 2F4F160CEF22; Fri, 15 May 2020 22:50:15 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id DHwh6sPgqHHu; Fri, 15 May 2020 22:50:15 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 0B2AC6224FDF; Fri, 15 May 2020 22:50:15 +0200 (CEST) Date: Fri, 15 May 2020 22:50:14 +0200 (CEST) From: Richard Weinberger To: Eric Biggers Cc: Sascha Hauer , linux-mtd , Linux Crypto Mailing List , stable Message-ID: <568077266.223149.1589575814867.JavaMail.zimbra@nod.at> In-Reply-To: <20200515191704.GE1009@sol.localdomain> References: <20200502055945.1008194-1-ebiggers@kernel.org> <20200504071644.GS5877@pengutronix.de> <20200515191704.GE1009@sol.localdomain> Subject: Re: [PATCH] ubifs: fix wrong use of crypto_shash_descsize() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF68 (Linux)/8.8.12_GA_3809) Thread-Topic: ubifs: fix wrong use of crypto_shash_descsize() Thread-Index: z+OnJhSOitcsTV8I0Jz25cDAthIH9w== Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "Eric Biggers" > An: "Sascha Hauer" , "richard" > CC: "linux-mtd" , "Linux Crypto Mailing List" , "stable" > > Gesendet: Freitag, 15. Mai 2020 21:17:04 > Betreff: Re: [PATCH] ubifs: fix wrong use of crypto_shash_descsize() > On Mon, May 04, 2020 at 09:16:44AM +0200, Sascha Hauer wrote: >> 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 >> > > Richard, could you take this through the ubifs tree for 5.8? Sure. I actually will send a PR with various MTD related fixes for 5.7. Thanks, //richard