Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp834311ybk; Wed, 13 May 2020 14:30:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5XpDj06iueioCUIfM7LbkRSajKjy41V3ibpP/3TziRDaQqq3xVTc+ORpmAgE08kOj6K1X X-Received: by 2002:a17:906:2f90:: with SMTP id w16mr1016309eji.252.1589405452844; Wed, 13 May 2020 14:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589405452; cv=none; d=google.com; s=arc-20160816; b=HjoscSWvN3cK5ZfB3UA2xfiiSnRImUtB+bN/47B3KtM71JtEr42Z3TOmJ+xXjfKYVi L9Cj0utY7vBLSnBq+q+yIu45kd+rNtAfCOzMGu/9nvMgicPqr1FZB+/lYetOBxubhayO DHEi5y9Nsv9DtIEVje66H3rC1B/Z0F7aLGhx2j0jVWYYEt4h/s7iL7o/FsBIRY9Ivt31 M4gK2rBwrASB69VPKGgX9ow3epqdm3WOEkOTslFpmK04btAYNpxuom2Mo5f0oc0pGOBm D4q4jZcUrZeUOXC7s2milemMDZICm5vBNtuAmL5kUMC82vf0kRw1lpJP5ZCN3VQK8+li eYAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jFpZxJjBWza/kWR3tD171A9RdRcfWTU4Z4g63bnqZJQ=; b=f+/MID826bpd6/CpIorxczBhsAC0oKdAyDKCdu9VEWa0jGg04quxzQGvckDk/ek4WU /tgLbzN1FbVp1v3oaZc/SQlrWLV8Gt716yYbRfgUkNy9UNMwk83C1D5Ieo1kF4KzZrTJ GpAPkKW1Zk/WWL8YcMmvzb/WWEEpx8CQrYsIzx34i89psZm8EXVOJkgaYsulKVimPaoJ nva54tnkwSqB/IP2GX9r/Abp3aAQCSqIHVk/M5MegdCGrTHSxdWWPdlFQ006HMSOncSA vPScYP+jqaBUDtZNAVXfZvP5CryHKCMaht58/iTpSliLPV7vlGIQY+gc8cgDqvEb9EZI EXlA== ARC-Authentication-Results: i=1; mx.google.com; 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 ss21si580096ejb.124.2020.05.13.14.30.30; Wed, 13 May 2020 14:30:52 -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; 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 S1729259AbgEMV2w (ORCPT + 99 others); Wed, 13 May 2020 17:28:52 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:50457 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728879AbgEMV2u (ORCPT ); Wed, 13 May 2020 17:28:50 -0400 Received: by mail-pj1-f65.google.com with SMTP id t9so11666936pjw.0; Wed, 13 May 2020 14:28:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=jFpZxJjBWza/kWR3tD171A9RdRcfWTU4Z4g63bnqZJQ=; b=MXCkU6xI6IpcuACtIHMntxwRWcX5rt9K4YNzkCn+FF6wXtHQSwhfb84wUHf8iSNe4J +KmNJgVPnwCnIdC9PujSz50jeePyRF4FfjbkCbtU9s3Ph+OzvS5q1nEQMSu10koDvjjC bU3B53dxr9P/pF856iTKjhEyRi7j5BeWoSVks68BEDRCUfQ+zNs2zQwygxZ27dilh+L1 iutpZRFnjZTHs5PIwGUzeBdUZMjB9YRMrGlFeFFalyorWVRym2bFqM847OOjaEkF35/u 14h7gaxzyBEp0VCpdz8ZGdoQ4plJJzosX4wo5j+SzydlgtOXz1v+MzPDDDM1Bq3VUBrH fTDA== X-Gm-Message-State: AGi0Pua5Q5h8OqRvZ/Lnh2+pXKFC/ecP3QSamFmB54DeI5khulfXSr64 byHbXx66Z7hapTqZV3ADv0N7sh449Mlmlg== X-Received: by 2002:a17:90a:9311:: with SMTP id p17mr36891312pjo.145.1589405329840; Wed, 13 May 2020 14:28:49 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id 82sm414078pfv.214.2020.05.13.14.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 14:28:48 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id D5FDC4063E; Wed, 13 May 2020 21:28:47 +0000 (UTC) Date: Wed, 13 May 2020 21:28:47 +0000 From: Luis Chamberlain To: Mimi Zohar Cc: Scott Branden , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann , "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 Subject: Re: [PATCH v5 1/7] fs: introduce kernel_pread_file* support Message-ID: <20200513212847.GT11244@42.do-not-panic.com> 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> <1589404814.5098.185.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1589404814.5098.185.camel@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 05:20:14PM -0400, Mimi Zohar wrote: > 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 Would a pre and post lsm hook for pread do it? Luis