Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp831064ybk; Wed, 13 May 2020 14:24:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtKTL4dZWELwLVT4gSbdH6o2n5iW/kVwxeqx/MLHuZv6AU7ajpQfZPKsxkfVECgwBnpqdO X-Received: by 2002:a50:8b42:: with SMTP id l60mr1406366edl.55.1589405077315; Wed, 13 May 2020 14:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589405077; cv=none; d=google.com; s=arc-20160816; b=mj30lzC/bAwRdl6hvIMJ7jGo45eqMvCPX71E3HASn5NeA74n98cT2YUXTsDOznSf8/ R4mhzWpIYPlbova9R3d1w5uY1rQWfJ9w3yrTt9TajE/67phus311lwnRGolYpbhupuyI 5/5jwCANfyhMqhRGsSN7jS6JJ1/iXIcJrhF0fwnIrjl5ijr7DIP5HPgWeGuiS1abvqSi wjtkVp6xThh9xFfPWP4VLPo+A6MPtw7FAz64FMtnQ+qiWnzI+RMbkC3jtkwtCLltcJLs ZAWDDmgSKShw6EF1BZ9FVn7KcajZ5WUN4Y9aZlXElW869Y6FymGrFH8Mi3uJ5wkncHLr d4dA== 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=yj0NtxYDwplD7Qc5QHJ1VB1nxXC7tYHbv6590FC3HgI=; b=nPXdB28U00s1blnJBF46S1OwW3FdHI62qVxkmNnIQFoo9lRZxa3ycH82bU+yPNsgCa vJpTe67lE4B44yeCvMhelTpMuELtbL6K2dB9s2/0OziRdv/ALzwTJyHnj/mqVGI58Iap +n/umwEkSkmHwNtJO45Q9LVwRSwu476sAV8rOe6+OfDXX+8MDYh8ZcM0EuEf7pnvJMuT 26DUkPv+1Ob/zCP1+dSQ++Bu0iF2/uYW2bgIz3OjTct/mYR9xdycvtlqrmfkRNxA73ib 2AczjoIgozjy7KXlbOZJHPE9jMsVaTkj6mx+Ya68dGBHW4+l/qafky7eGYhDjMFjEbNZ hgqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PwJfPtEX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 e23si360257ejr.357.2020.05.13.14.24.14; Wed, 13 May 2020 14:24:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=PwJfPtEX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1728610AbgEMVUS (ORCPT + 99 others); Wed, 13 May 2020 17:20:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbgEMVUS (ORCPT ); Wed, 13 May 2020 17:20:18 -0400 Received: from localhost.localdomain (pool-96-246-152-186.nycmny.fios.verizon.net [96.246.152.186]) (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 38336205ED; Wed, 13 May 2020 21:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589404817; bh=xWHjq8JYrcnKLKaLhAt/3Qu+CGeCVNq+g1GySEuPYRc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PwJfPtEX6tp0QTHNEjB9QjrHmEOqN4ySwN4pxgVhjjg3ETeUb0TY4DXaxevUnby8+ EokyG0p+/y45QWzXzEKs2sgYFqd+tkFTTlPWzX0xov+GrSpiQ9A29xKfyJOHTMmiL3 i/n7KTWK2eIQJQSIq4Y9w8AfkxzotlkTFt2FmPX8= Message-ID: <1589404814.5098.185.camel@kernel.org> Subject: Re: [PATCH v5 1/7] fs: introduce kernel_pread_file* support From: Mimi Zohar To: Scott Branden , Luis Chamberlain , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann Cc: "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross , linux-security-module , linux-integrity Date: Wed, 13 May 2020 17:20:14 -0400 In-Reply-To: References: <20200508002739.19360-1-scott.branden@broadcom.com> <20200508002739.19360-2-scott.branden@broadcom.com> <1589395153.5098.158.camel@kernel.org> <0e6b5f65-8c61-b02e-7d35-b4ae52aebcf3@broadcom.com> <1589396593.5098.166.camel@kernel.org> <1589398747.5098.178.camel@kernel.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-05-13 at 12:41 -0700, Scott Branden wrote: > > On 2020-05-13 12:39 p.m., Mimi Zohar wrote: > > On Wed, 2020-05-13 at 12:18 -0700, Scott Branden wrote: > >> On 2020-05-13 12:03 p.m., Mimi Zohar wrote: > >>> On Wed, 2020-05-13 at 11:53 -0700, Scott Branden wrote: > >> Even if the kernel successfully verified the firmware file signature it > >> would just be wasting its time.  The kernel in these use cases is not always > >> trusted.  The device needs to authenticate the firmware image itself. > > There are also environments where the kernel is trusted and limits the > > firmware being provided to the device to one which they signed. > > > >>> The device firmware is being downloaded piecemeal from somewhere and > >>> won't be measured? > >> It doesn't need to be measured for current driver needs. > > Sure the device doesn't need the kernel measuring the firmware, but > > hardened environments do measure firmware. > > > >> If someone has such need the infrastructure could be added to the kernel > >> at a later date.  Existing functionality is not broken in any way by > >> this patch series. > > Wow!  You're saying that your patch set takes precedence over the > > existing expectations and can break them. > Huh? I said existing functionality is NOT broken by this patch series. Assuming a system is configured to measure and appraise firmware (rules below), with this change the firmware file will not be properly measured and will fail signature verification. Sample IMA policy rules: measure func=FIRMWARE_CHECK appraise func=FIRMWARE_CHECK appraise_type=imasig Mimi