Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp802291ybd; Sat, 22 Jun 2019 15:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbIz/nQWBhf52VgQTKUp/SQ5qRClfpsz4t2Ausm6q5OkqGYw7Qvz/WDi7YJK882edyXHCT X-Received: by 2002:a63:2249:: with SMTP id t9mr25593195pgm.149.1561243475131; Sat, 22 Jun 2019 15:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561243475; cv=none; d=google.com; s=arc-20160816; b=khTiu28xMZoRLkDwfiuUjcjuCDD0uoGK1MHKuBYtx6hjRrkJXp4aje+gMa2qWK3Lym /wHYeG93Vz5gdphWoyrlw2IJHq6Dy5yLLA4DWlJ8AFDyrdcaLkC94G3k0xFFIY/5fbr5 a5DIH4AL2gtaWRt80QfIvHoa6H+JIT/osVVo69b5xoOl88xnjD1Uk6iZYmxQD8XJ+ak2 ZVqekmQN9DqnGXojn1ni/pz4K/GhxifB3t1Janc+A2OFSYP/mRYfxiP4+BqP5rQEHlDT zN3D18oYyzSUc9CGNdSbe9yLvx775I7ZZau2+U5v8u9Z3I8Q/C+/dAyQiT+wORnke68+ BT6Q== 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:dkim-signature; bh=70M119sgCdkQVsqwrqyBy1GZYcJMkC05SKJlHGZQiCo=; b=tZLFjSbovf8Mimh5uxoyaa+u7evjgYudMEuqv7Nm/bfzmvE0DMRFJMHVhsezcURCh6 M63WtqqfuH8Qerb8GKffuT834iD7diuRTZHfcMMpZmMfCZAmdgtWMn+7Esr8QgFj+b6S cZsyqMCIGwyem3FUF9pXJ4cC1Tbt7Lqoj3fZg7D9YuroBowTuWvhsAo1KRhaLs3cXpQ1 RdfN2J4RetPa5w8QSJdFjciCwrprThAsuiblHRAuoGrKuEGmOEX93/oUTkqQgF83hF2G sJA/jtHsqVXctlnpMLus7eul6qjiWOcIKho7T0wkTLrVFaGWij4cuxnIiiQpAGkmsrtW 3NVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v9rm9f4U; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si5816191pgq.61.2019.06.22.15.44.21; Sat, 22 Jun 2019 15:44:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v9rm9f4U; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726401AbfFVWoC (ORCPT + 99 others); Sat, 22 Jun 2019 18:44:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:50704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726343AbfFVWoB (ORCPT ); Sat, 22 Jun 2019 18:44:01 -0400 Received: from localhost (unknown [104.132.1.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 997D32084E; Sat, 22 Jun 2019 22:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561243440; bh=iYQDhANCCK0G30rvhkm7fehvp1qj9IVh4v7axFSmMDk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v9rm9f4UnXG+IojsZCZMQscfYooXc2HeSrZMJbIbGXrZyS/a1XJ6VTTDKpvfOnwns Lo520pl0gERcKUUoy99M9nG6hAJQeL2sjSizQbFjzqRtTlq7tIJNAaeU/O6WmhbU3n cGGui0kXq2U+i05PpLOii8UzoX3BBopulnSWFURc= Date: Sat, 22 Jun 2019 15:44:00 -0700 From: Jaegeuk Kim To: Eric Biggers Cc: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-integrity@vger.kernel.org, "Theodore Y . Ts'o" , Victor Hsieh , Chandan Rajendra , Dave Chinner , Christoph Hellwig , "Darrick J . Wong" , Linus Torvalds Subject: Re: [PATCH v5 12/16] fs-verity: add SHA-512 support Message-ID: <20190622224400.GL19686@jaegeuk-macbookpro.roam.corp.google.com> References: <20190620205043.64350-1-ebiggers@kernel.org> <20190620205043.64350-13-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190620205043.64350-13-ebiggers@kernel.org> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 06/20, Eric Biggers wrote: > From: Eric Biggers > > Add SHA-512 support to fs-verity. This is primarily a demonstration of > the trivial changes needed to support a new hash algorithm in fs-verity; > most users will still use SHA-256, due to the smaller space required to > store the hashes. But some users may prefer SHA-512. > > Reviewed-by: Theodore Ts'o Reviewed-by: Jaegeuk Kim > Signed-off-by: Eric Biggers > --- > fs/verity/fsverity_private.h | 2 +- > fs/verity/hash_algs.c | 5 +++++ > include/uapi/linux/fsverity.h | 1 + > 3 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h > index eaa2b3b93bbf6b..02a547f0667c13 100644 > --- a/fs/verity/fsverity_private.h > +++ b/fs/verity/fsverity_private.h > @@ -29,7 +29,7 @@ struct ahash_request; > * Largest digest size among all hash algorithms supported by fs-verity. > * Currently assumed to be <= size of fsverity_descriptor::root_hash. > */ > -#define FS_VERITY_MAX_DIGEST_SIZE SHA256_DIGEST_SIZE > +#define FS_VERITY_MAX_DIGEST_SIZE SHA512_DIGEST_SIZE > > /* A hash algorithm supported by fs-verity */ > struct fsverity_hash_alg { > diff --git a/fs/verity/hash_algs.c b/fs/verity/hash_algs.c > index 46df17094fc252..e0462a010cabfb 100644 > --- a/fs/verity/hash_algs.c > +++ b/fs/verity/hash_algs.c > @@ -17,6 +17,11 @@ struct fsverity_hash_alg fsverity_hash_algs[] = { > .digest_size = SHA256_DIGEST_SIZE, > .block_size = SHA256_BLOCK_SIZE, > }, > + [FS_VERITY_HASH_ALG_SHA512] = { > + .name = "sha512", > + .digest_size = SHA512_DIGEST_SIZE, > + .block_size = SHA512_BLOCK_SIZE, > + }, > }; > > /** > diff --git a/include/uapi/linux/fsverity.h b/include/uapi/linux/fsverity.h > index 57d1d7fc0c345a..da0daf6c193b4b 100644 > --- a/include/uapi/linux/fsverity.h > +++ b/include/uapi/linux/fsverity.h > @@ -14,6 +14,7 @@ > #include > > #define FS_VERITY_HASH_ALG_SHA256 1 > +#define FS_VERITY_HASH_ALG_SHA512 2 > > struct fsverity_enable_arg { > __u32 version; > -- > 2.22.0.410.gd8fdbe21b5-goog