Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2122450pxb; Fri, 25 Mar 2022 11:28:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHFR02QB9WbhWgwiMYqKzVBxPb40ZDmpJm0k3F19+/r5eEwfpSzmrPbdZnaBZ8T3GPHo/t X-Received: by 2002:a17:902:c745:b0:153:b0e:8586 with SMTP id q5-20020a170902c74500b001530b0e8586mr12786526plq.9.1648232935544; Fri, 25 Mar 2022 11:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648232935; cv=none; d=google.com; s=arc-20160816; b=qXuHxMsnu+J52eYKPC8eVvBerQnYdRAaELsTsYq/o6YtOxN2onrFoNHFefUOEgYTvW 3xLU7hg1Mq0V/jD7J5xW8jCuNkBwAmh65z26vYQMpPGJUNAazuwgoa80ypVO/jlN44Ff dCuKmNtNNqlm6p6lQZWqFM/5s8GZcmyZLu5xFbEjGvdL44i7W1gcjtSqtva1OCmlWz2m iK+DQxan8/l42nYTqvtNbPU67b9a5z8yAWKnrg9ytdRZQiFAQqSbaNiUB3rHhF6ZTsAR Y7rKNV12focD6d9lYmMtheqN+UJlROvFywnovw3QDCYu0R+LyKjhw4XeTIloxJCUAvQd VDmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=goJB0SCqo5d39ZSNDAI7BU78CtP+9thRdvFF6R5J+wc=; b=SBI8rDtQoocPMdo4dSxQHWyHtOYuoj2HZFg0ycqV/5K1d+vAuWeS17g2t9PtPWIhYl jbszGuk7H+uu6WQBvrArg4kIWR9ZFGsuAbMuWWmjBypJZugqGYKflOTo3Zn9NMXBkJ+S mvabpGLuxtRbtxOHebOFvqjfBze+VaZTPjbTC/auVJ0dDRO/xdacxWTcI3yFGZxMT79L LiDEyqA7NFIu/vTOenwNNtXe4AAKv4WupLmfHSVbmYWoxlFISWvmJvaWXcTa2jvxYX2k 1Wo+meTZ1fDBA0uMjTRLuYPOQHkecoUOBcb42t3RcXNmR5wyCXVQRXBeMlmqAd87r2Zx wRlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=A+wnsv4V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m4-20020a17090ade0400b001bedf1f3526si6078408pjv.146.2022.03.25.11.28.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:28:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=A+wnsv4V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 52D1017ECD9; Fri, 25 Mar 2022 10:51:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351649AbiCYMdU (ORCPT + 99 others); Fri, 25 Mar 2022 08:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355069AbiCYMcv (ORCPT ); Fri, 25 Mar 2022 08:32:51 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0953CD080C; Fri, 25 Mar 2022 05:31:17 -0700 (PDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22PAS6J6013215; Fri, 25 Mar 2022 12:31:15 GMT 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=goJB0SCqo5d39ZSNDAI7BU78CtP+9thRdvFF6R5J+wc=; b=A+wnsv4VInGsI6YKMTOyxSPCHej84JaylddJWXa6MNlPUx0Wutle5qE/uTtPREa9YZb9 u/Os8thesgO5U5ciDqL1QqPsk/qbbGBXBPWfsIgC7puN8G/ICeJo1fCGPxZ3t4Gck6KM E3tzjsYeHV9uhBxcqJPmJeCtMCvBOKp7Z33Wv6eDrUfNN4Y4l/Vr3WasrdwaRhpr/Rgt Pcexh1lNbtQOdnVLOtayrI52YF5sVkF4uUTXKktRkYur9y4qX2RGBaFlPDPf1XMyxPHs XTXWGAhyC5y3Ca2WycRvnzusp3PHRnJ3eQoHHrzE+iSE2XY0kj3N71Q3U5AiojyGWeeY qA== Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com with ESMTP id 3f0t26y2pj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Mar 2022 12:31:14 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22PCD6SS026663; Fri, 25 Mar 2022 12:31:12 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma06fra.de.ibm.com with ESMTP id 3ew6ej3aqk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Mar 2022 12:31:12 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22PCVA9N54985002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Mar 2022 12:31:10 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4583C11C04A; Fri, 25 Mar 2022 12:31:10 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A8E011C04C; Fri, 25 Mar 2022 12:31:09 +0000 (GMT) Received: from sig-9-65-72-52.ibm.com (unknown [9.65.72.52]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 25 Mar 2022 12:31:09 +0000 (GMT) Message-ID: <9bda9c8a9f161763f420bf8e7bd639fe0d7e1691.camel@linux.ibm.com> Subject: Re: [PATCH v6 4/5] ima: support fs-verity file digest based version 3 signatures From: Mimi Zohar To: Stefan Berger , linux-integrity@vger.kernel.org Cc: Eric Biggers , linux-fscrypt@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 25 Mar 2022 08:31:08 -0400 In-Reply-To: References: <20220318182151.100847-1-zohar@linux.ibm.com> <20220318182151.100847-5-zohar@linux.ibm.com> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 6RIghj8AlccUgY2wbnH3it5WzrtsKJa8 X-Proofpoint-GUID: 6RIghj8AlccUgY2wbnH3it5WzrtsKJa8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-25_02,2022-03-24_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 clxscore=1015 impostorscore=0 malwarescore=0 spamscore=0 adultscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203250070 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2022-03-21 at 09:10 -0400, Stefan Berger wrote: > > On 3/18/22 14:21, Mimi Zohar wrote: > > IMA may verify a file's integrity against a "good" value stored in the > > 'security.ima' xattr or as an appended signature, based on policy. When > > the "good value" is stored in the xattr, the xattr may contain a file > > hash or signature. In either case, the "good" value is preceded by a > > header. The first byte of the xattr header indicates the type of data > > - hash, signature - stored in the xattr. To support storing fs-verity > > signatures in the 'security.ima' xattr requires further differentiating > > the fs-verity signature from the existing IMA signature. > > > > In addition the signatures stored in 'security.ima' xattr, need to be > > disambiguated. Instead of directly signing the fs-verity digest, a new > > signature version 3 is defined as the hash of the ima_file_id structure, > > which identifies the type of signature and the digest. > > Would it not be enough to just differentiat by the type of signature > rather than also bumping the version? It's still signature_v2_hdr but a > new type IMA_VERITY_DIGSIG is introduced there that shoud be sufficient > to indicate that a different method for calculating the hash is to be > used than for anything that existed before? sigv3 would then become the > more obvious veriftysig... ? One of Eric's concerns was that, "an attacker (who controls the file's contents and IMA xattr) [could] replace the file with one with a differrent content and still be able to pass the IMA check." His solution was to only allow one signature version on a running system. For the complete description of the attack, refer to Eric's comments on v3. Instead of only allowing one signature version on a running system, subsequent versions of this patch set addressed his concern, by limiting the signature version based on policy. -- thanks, Mimi