Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp782078imm; Fri, 31 Aug 2018 13:08:16 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb1IrQdnWlLR1nTuH+JXmE07PORTK+OZJbAWvn59Lm4ZSg5EWuQM6GDPpL+n1L/oIUn+pp5 X-Received: by 2002:a65:60cf:: with SMTP id r15-v6mr14084388pgv.41.1535746096242; Fri, 31 Aug 2018 13:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535746096; cv=none; d=google.com; s=arc-20160816; b=LmCdpkTPAj/DwHxKGYoDhUbxndrteGPrHYqwS1RV4/tB52IufabZeU9mkXdjfsyx9N rND/5d0NTkEnldKtjhhjeqyoZevICz9giqSGMDuSjughR8eaZZorwLLQ8B3fga98FD8N nPqdj7TzGJIlCVtECKFqMzhARyLRnwT9f7OsDVm/TzyPScSi5QYYSb1pExe4e+hKsrCX DSyzfwts9j/SF6YKIha9OQRwX/D73N6WETs2f69fvqiJrzaoFlXjOrY2YOSlX017Si8H ++d66eKj78dCE+yz9MgH1LIFIVh/OdfLQA6wwLG45GOFVlo1zm7RytzxhuVXFgBFMevG O9Wg== 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 :organization:references:in-reply-to:date:cc:to:reply-to:from :subject:message-id:arc-authentication-results; bh=TRL/gGl5q5D9VEKVxFdpYiByaiAEpSSoehRoypkmDto=; b=uhO4AQmJjjYFswaizgU40fhNFt/xFMsxT0rU/nTJQLfIh+s2ttzTa/WsREyvHvOaWq DnYZ5Vh2/1e/iMMKJq/82aPPwwLsBcS3gx5qVXD8VFdu4FDZjJ/fwf05vCdr0EiRjGQQ FWVHUugYVumc3FVI5pF99gMOdT+RkqcQWqiQhI4ApmFE2xsXdOkTjTAZCIjMGU+v3Jc0 uIFZvotjjkCHIiDIZQrRNfl076ie6fPnD5dQ+YbuDKRuDYYa46I16GdDYnDhgn4yQaNu HM3puo/reDiZ39c9647Efo1WlPNxZZNidnt208yggJCbT5rzUAuVwvEj9dpQKPt8XLlw EiGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1-v6si10752434pli.412.2018.08.31.13.08.00; Fri, 31 Aug 2018 13:08:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727434AbeIAAOg (ORCPT + 99 others); Fri, 31 Aug 2018 20:14:36 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:51939 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726987AbeIAAOg (ORCPT ); Fri, 31 Aug 2018 20:14:36 -0400 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvpfa-0001L3-Dr; Fri, 31 Aug 2018 22:05:26 +0200 Received: from localhost ([127.0.0.1]) by ptx.hi.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1fvpfZ-0004tU-3o; Fri, 31 Aug 2018 22:05:25 +0200 Message-ID: <1535745923.25742.1.camel@pengutronix.de> Subject: Re: [RFC PATCH 00/10] fs-verity: filesystem-level integrity protection From: Jan =?ISO-8859-1?Q?L=FCbbe?= Reply-To: jlu@pengutronix.de To: Eric Biggers , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: linux-integrity@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-kernel@vger.kernel.org, Mimi Zohar , Dmitry Kasatkin , Michael Halcrow , Victor Hsieh Date: Fri, 31 Aug 2018 22:05:23 +0200 In-Reply-To: <20180824161642.1144-1-ebiggers@kernel.org> References: <20180824161642.1144-1-ebiggers@kernel.org> Organization: Pengutronix Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: jlu@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-08-24 at 09:16 -0700, Eric Biggers wrote: [...] > Since fs-verity provides the Merkle tree root hash in constant time and > verifies data blocks on-demand, it is useful for efficiently verifying > the authenticity of, or "appraising", large files of which only a small > portion may be accessed -- such as Android application (APK) files.  It > can also be useful in "audit" use cases where file hashes are logged. > fs-verity also provides better protection against malicious disk > firmware than an ahead-of-time hash, since fs-verity re-verifies data > each time it's paged in. [...] > Feedback on the design and implementation is greatly appreciated. Hi, I've looked at the series and the slides linked form the recent lwn.net article, but I'm not sure how fs-verity intends to protect against malicious firmware (or offline modification). Similar to IMA/EVM, fs- verity doesn't seem to include the name/location of the file into it's verification. So the firmware/an attacker could replace one fs-verity- protected file with another (maybe a trusted system APK with another one for which a vulnerability was discovered, or /sbin/init with /bin/sh). Is the expected root hash of the file provided from somewhere else, so this is not a problem on Android? Or is this problem out-of-scope for fs-verity? For IMA/EVM, there were patches by Dmitry to address this class of attacks (they were not merged, though): https://lwn.net/Articles/574221/ Thanks, Jan [1] https://events.linuxfoundation.org/wp-content/uploads/2017/11/fs-ve rify_Mike-Halcrow_Eric-Biggers.pdf -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |