Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp495663pxa; Thu, 27 Aug 2020 07:56:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOLvQF6JkOuo9icFn9SlGYsZX/xG+YFNBJ3T3SV4//CO/chMuFt5gfPpsJb2K/dXaweqK2 X-Received: by 2002:a17:906:2356:: with SMTP id m22mr14194563eja.452.1598540205260; Thu, 27 Aug 2020 07:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598540205; cv=none; d=google.com; s=arc-20160816; b=HPbG9j9axk8l7qrMMt1ML3KXbn8RbuAsqhnl+z4n2DIdCanLpVbVRai5NMY/5ecx4k Sgz+pLvd4Mxky+B73qIloEd1JokLIv/O8q8v5yhsBS4jEIV/ddS64bBpGfDWzWi46PeS 03OG/D6IwP6stNh9aWDhCisBjYBaEnmCznIKYT7nejs8S8/W3Eg/4QdXURuxUP3Oeg1D 6i10AOuKMQt39wJZsqdV3T54vUQaNX4JEEPkn6moLC67UDSwk8pAtbd23iOLcLvDyzdF SpVe4XpH3rmEa4J/LvF1gnP3wGnQKboeI8WPNVAc9kul2CtRLFzwlojoD/UagneStvmm BqBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=0jkqVoBjl8OMYPBJk+Af10MNs/hhkJn3XMX7JyTNZv0=; b=cwvkfTD1gM9l9NBRNHekmD65ddx5L4Atpgbi3s42d6VZ4akFjKmesjdz44lnajkBc4 s8bZprtdF7WdQ1gBpgzfD09CYAjQ5EBHLHHYh22cqhyViihICFKIHbDaQSlfyXUwZMFx Lm7wZnO4uFcodVZDrO/hWVtQm11FBboWzU3jt3BYCubHPsn55Sc1EtM+MQrOuyDt5r2J ZmmbWgjOovgsFESmVA8Rf+Kf/RYRFTL+2zF2QP88kOsxFeIHvxMjeGxZyQQijMUYIz3X aIZpcRvNE7eUhpv6AsIManBVH7HLK4r/Iz2vtCIj5PNljcZnmgTx48ayY//Si/Jh2gTt XPpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="j/lZ/Af1"; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si1664011edr.313.2020.08.27.07.56.20; Thu, 27 Aug 2020 07:56:45 -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=@ibm.com header.s=pp1 header.b="j/lZ/Af1"; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728008AbgH0Oyd (ORCPT + 99 others); Thu, 27 Aug 2020 10:54:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:21018 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbgH0NLT (ORCPT ); Thu, 27 Aug 2020 09:11:19 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07RD2ufG012233; Thu, 27 Aug 2020 09:10:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=0jkqVoBjl8OMYPBJk+Af10MNs/hhkJn3XMX7JyTNZv0=; b=j/lZ/Af1YQYbHrk2TkKLQORvKEvSvMnIGPM0g0J5ELCxZBP8j7HzCqN88vu+zGU3C/+u 20QFxnEQPqRZ0hcj/cey8PqreSuIlmOm87Yti909JFIBWMSIDBo/LKdZSx3yGLxEY7oh qK8vc3JCLi2TDZdY4/+Rpw1U9eJGOle4WUU6yIo5Ikh9LYUVhyf6GsMUVNpbmdlrhyzt PFG2gEWG7srycZwzC9OHpxupPh/A8cvfiX5UbVnPXiyyDlWeGaQ7naINTBIOuwdnZmXO jKFxwnOdi83afgkys0OI3r2UFez0pSUoedr5UkLfPN4alWBfWHL2e5QQvWpEpEonr4/X LA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 336aeke0ce-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Aug 2020 09:10:58 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07RD3ASq013524; Thu, 27 Aug 2020 09:10:57 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 336aeke0au-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Aug 2020 09:10:57 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07RD9Hm4020543; Thu, 27 Aug 2020 13:10:55 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma05fra.de.ibm.com with ESMTP id 335j270xrr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Aug 2020 13:10:54 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07RD9MsH62521618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Aug 2020 13:09:22 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9EF9852078; Thu, 27 Aug 2020 13:10:52 +0000 (GMT) Received: from li-f45666cc-3089-11b2-a85c-c57d1a57929f.ibm.com (unknown [9.160.6.101]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 0882952079; Thu, 27 Aug 2020 13:10:50 +0000 (GMT) Message-ID: Subject: Re: IMA metadata format to support fs-verity From: Mimi Zohar To: Eric Biggers Cc: Chuck Lever , linux-fscrypt@vger.kernel.org, linux-integrity@vger.kernel.org, Linux NFS Mailing List , Matthew Garrett Date: Thu, 27 Aug 2020 09:10:50 -0400 In-Reply-To: <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> <20200827010016.GA2387969@gmail.com> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.28.5 (3.28.5-12.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-27_07:2020-08-27,2020-08-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=947 malwarescore=0 mlxscore=0 suspectscore=0 bulkscore=0 phishscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008270094 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 2020-08-26 at 18:00 -0700, Eric Biggers wrote: > 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. I agree including the hash algorithm in the digest would be preferrable, but it isn't per-se broken. The file signature and the file metadata hash algorithms are the same, otherwise signature verification fails[1]. The same tool calculates the file metadata digest and then signs the digest, using the same hash algorithm. In terms of the HMAC, it is (still) limited to SHA1. Mimi [1] commit 5feeb61183dd ("evm: Allow non-SHA1 digital signatures")