Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp85378pxa; Wed, 26 Aug 2020 18:01:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+vmqUp+SLBeYxWrhYRrNMecBAC0giBmUTmadCmLHxjijkSuT8tTb4AutT1+qla5eADpSL X-Received: by 2002:a17:906:6c5:: with SMTP id v5mr18095487ejb.323.1598490089921; Wed, 26 Aug 2020 18:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598490089; cv=none; d=google.com; s=arc-20160816; b=kvdkkAo+quJHUnkYObMeyrNhNVbA5FXnDwFK6Vj2+O9vjjMaw9qg1NfjLVBLiPreF0 0KfRqY3Uy2VhzeqCCunYkLKTUlhynCEDwVlwPSK26Sw2iDqETFnSLEIs2B6rcWjHO1sY 4jgt0RlISPi0Q8izwkjemChp/7UkqvhE9bEy5t86jJPoeJDFvALvto6gC/B6jHKUQUQY CSjv7sTsIvwVwgl4gx2dmTW5cIhXVbZJ38tvqoVTxKA1euTH+RBgdy88BbnxpbkSdey/ aIiq2qK1Xkq8/5ik5daAIbdS8kwgn898PiEI8eD8H7dvGZvT4A27HbpIC8s1rPvY5WEJ W5NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JLLq6WK/Vli3bWz2ObHc5xoPt5AZsZz4mGAp+LLsDRY=; b=0NzMRcYrLBohBiYoYs2TMxJTp+lomJld9T6apciXGj31LLJ9Q7oz+p+4d854/4F472 O7fsI6nvUZbQ74KLcnZt4E0yJHOIavrJWijiOQjp0bdA5BNj54BDAF53Mas8xu7ITbAv k5gg73QnY9SCXBoBHVKRKlMWXPUv9AGuRAQ8KMJ2vVf3mbsU85QpJRDKJhIFGkbavbY4 LkhX95/9fkiFklZoLtj+3DkUgO7SAPNsBtBSg2l1IUMefSdBgKmp7jKUFzRxg7ZsnK9D QSYqKlewUaeUogkJUiL4sI3PnvV0v2R9Udmq6HzKii+3c0cCwveMiBkUAfsiB3iC6mR1 We6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IKgkjyji; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-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. [23.128.96.18]) by mx.google.com with ESMTP id h1si489375edk.240.2020.08.26.18.01.04; Wed, 26 Aug 2020 18:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IKgkjyji; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-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 S1726804AbgH0BAS (ORCPT + 99 others); Wed, 26 Aug 2020 21:00:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:46934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbgH0BAR (ORCPT ); Wed, 26 Aug 2020 21:00:17 -0400 Received: from gmail.com (unknown [104.132.1.76]) (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 6B5DA20791; Thu, 27 Aug 2020 01:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598490017; bh=MuJK6Fq+nQHmaii7dvnYwwfnvKbk+kTDRV/j52dDGiI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IKgkjyjizAHqIEOeRAxxLaUn5tt7PDAwnqjns7AwvKMNXVmzm3mBAMGlDZuE0CilN SX3CfQPQtP5PAXoNxSvWfCSGMwbu/LL1CJEbDRgFR0/Ut13F3kP+cnbglGrmGscX+Q H/3PtTLYAT8bN8Z+tvLdeColWwcPQdKzaN1SK8cI= Date: Wed, 26 Aug 2020 18:00:16 -0700 From: Eric Biggers To: Mimi Zohar Cc: Chuck Lever , linux-fscrypt@vger.kernel.org, linux-integrity@vger.kernel.org, Linux NFS Mailing List Subject: Re: IMA metadata format to support fs-verity Message-ID: <20200827010016.GA2387969@gmail.com> References: <760DF127-CA5F-4E86-9703-596E95CEF12F@oracle.com> <20200826183116.GC2239109@gmail.com> <6C2D16FB-C098-43F3-A7D3-D8AC783D1AB5@oracle.com> <20200826192403.GD2239109@gmail.com> <20200826205143.GE2239109@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Aug 26, 2020 at 08:53:33PM -0400, Mimi Zohar wrote: > On Wed, 2020-08-26 at 13:51 -0700, Eric Biggers wrote: > > Of course, the bytes that are actually signed need to include not just the hash > > itself, but also the type of hash algorithm that was used. Else it's ambiguous > > what the signer intended to sign. > > > > Unfortunately, currently EVM appears to sign a raw hash, which means it is > > broken, as the hash algorithm is not authenticated. I.e. if the bytes > > e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 are signed, > > there's no way to prove that the signer meant to sign a SHA-256 hash, as opposed > > to, say, a Streebog hash. So that will need to be fixed anyway. While doing > > so, you should reserve some fields so that there's also a flag available to > > indicate whether the hash is a traditional full file hash or a fs-verity hash. > > The original EVM HMAC is still sha1, but the newer portable & immutable > EVM signature supports different hash algorithms. > Read what I wrote again. I'm talking about the bytes that are actually signed. - Eric