Received: by 10.192.165.148 with SMTP id m20csp579688imm; Wed, 9 May 2018 19:01:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr5zmEkex6Jr74Gt4sTWEMD2td6rjUf6LYYvjPkYzcRdUnqh82sNeOS5yPPoRHCX9Nny92M X-Received: by 2002:a63:6108:: with SMTP id v8-v6mr37484177pgb.245.1525917702934; Wed, 09 May 2018 19:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525917702; cv=none; d=google.com; s=arc-20160816; b=SO9CjNvAgIq/sS5AZQ6Nn7GvcS0rPhu2JGJ8KzGImYayDkWiYZV9A1G75qBOMGOsln QMJga9/LuM+oL0cRi2nnRUiIVzPBTxi0CBvqeNiEP/MRlbCtNM9MBRNPr/CMqETvEjZr F7G+fIlOIh7whDg42UwicGebmK2svb1/B6RbPUXiCm2RftdcVlsYIm7s6IKmdcr+CEJg If39pZ8PxJEpUzU4xqJW2fNJIzvKzjyX6Seu1cAXLZ4GcWBI6h8DuQCI0xEwS3YPmr54 RLPcR2jeZXriaIu8I4CHAAqIvH55vKjXPCOXlvQP5crSvxG5Iz+r2/ENSte2rkcPWPSM LehA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject :arc-authentication-results; bh=GQjFKILrn6x+2RHwUBE7RqWsnxc24pdbHUWLZX48Cas=; b=K7Sdjt/XadnQf6nHfHCi7mw5iZYZL7l0+yTzWUWwJ7ssaPyo0gAvw147kgLt5/tKq2 YVGvacwteiqO2QfIbV9owgTz8z6gAjYDlRM6qmkir2mvYPjpZ1hqWNMjayTcJSpUA2+h LsbCV71xrevPOhXdaOsW49M+4jyZTtWF7asNpzAZXsNid/+BZhVjbRWSRGLO7ERAsl3X iqeSu383o28ay/ktFjOEUiJmNi5ttzNF3irNU2dcI4aFBime5+m6u3Bo8MVb5wv0HFfN fpUG2ZHvdFCZDaDyzPyd+S9ncdCKl97a8Ga3EHscJGhRoUvqjvGCCSDOa6EblIn8ivHt u7mw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8-v6si11461055pgr.65.2018.05.09.19.01.27; Wed, 09 May 2018 19:01:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756477AbeEJCBN (ORCPT + 99 others); Wed, 9 May 2018 22:01:13 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47634 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756306AbeEJCBK (ORCPT ); Wed, 9 May 2018 22:01:10 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4A1xCYT033021 for ; Wed, 9 May 2018 22:01:10 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hv9s16u4w-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 09 May 2018 22:01:10 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 May 2018 03:01:07 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 10 May 2018 03:01:02 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4A211f846465146; Thu, 10 May 2018 02:01:01 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFF5742013; Thu, 10 May 2018 02:52:02 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48CB242014; Thu, 10 May 2018 02:52:00 +0100 (BST) Received: from localhost.localdomain (unknown [9.80.105.58]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 10 May 2018 02:52:00 +0100 (BST) Subject: Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware From: Mimi Zohar To: "Luis R. Rodriguez" , Matthew Garrett , Peter Jones , "AKASHI, Takahiro" , David Howells Cc: linux-wireless , Kalle Valo , Seth Forshee , Johannes Berg , linux-integrity@vger.kernel.org, Hans de Goede , Ard Biesheuvel , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Greg Kroah-Hartman , Andres Rodriguez , Linus Torvalds , Andy Lutomirski , Casey Schaufler Date: Wed, 09 May 2018 22:00:58 -0400 In-Reply-To: <20180509234814.GY27853@wotan.suse.de> References: <1525182503-13849-1-git-send-email-zohar@linux.vnet.ibm.com> <1525182503-13849-4-git-send-email-zohar@linux.vnet.ibm.com> <20180504000743.GR27853@wotan.suse.de> <1525393466.3539.133.camel@linux.vnet.ibm.com> <20180508173404.GG27853@wotan.suse.de> <1525865428.3551.175.camel@linux.vnet.ibm.com> <20180509191508.GR27853@wotan.suse.de> <1525895838.3551.247.camel@linux.vnet.ibm.com> <20180509212212.GX27853@wotan.suse.de> <1525903617.3551.281.camel@linux.vnet.ibm.com> <20180509234814.GY27853@wotan.suse.de> 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 X-TM-AS-GCONF: 00 x-cbid: 18051002-0044-0000-0000-00000550FA18 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051002-0045-0000-0000-000028924454 Message-Id: <1525917658.3551.322.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-09_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805100016 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-05-09 at 23:48 +0000, Luis R. Rodriguez wrote: > On Wed, May 09, 2018 at 06:06:57PM -0400, Mimi Zohar wrote: > > On Wed, 2018-05-09 at 21:22 +0000, Luis R. Rodriguez wrote: > > > > > > OK, its still not clear to what it will do. If it does not touch the firmware > > > loader code, and it just sets and configures IMA to do file signature checking > > > on its own, then yes I think both mechanisms would be doing the similar work. > > > > > > Wouldn't IMA do file signature checks then for all files? Or it would just > > > enable this for whatever files userspace wishes to cover? > > > > Enabling CONFIG_IMA_APPRAISE_FIRMWARE would enforce firmware > > signatures on all directly loaded firmware and fail any method of > > loading firmware that the signature couldn't be verified. > > Ah, so a generic firmware signing mechanism via IMA. Sounds very sensible to me. > Specially in light of the fact that its what we recommend folks to consider > if they need to address firmware signing for devices which do not have the > ability to do hardware firmware signing verification on their own. > > > > One of the things with READING_FIRMWARE_REGULATORY_DB is to also use and trust > > > the wireless-regdgb maintainer's key for this file, could IMA be configured to > > > do that? > > > > IMA has its own trusted keyring.  So either the maintainer's key would > > need to be added to the IMA keyring, > > I see so we'd need this documented somehow. > > > or IMA-appraisal would need to use the regdb keyring. > > Can you describe this a bit more, for those not too familiar with IMA, in terms > of what would be involved in the kernel? Or is this all userspace configuration > stuff? I think it's a bit premature to be discussing how IMA could add the builtin regulatory key to its keyring or use the regdb keyring, as IMA-appraisal doesn't (yet) support detached signatures. The other option would be to include the regulatory.db signature in the package.  For rpm, the file signature is included in the RPM header.  Multiple attempts have been made to have Debian packages include file signatures.  This is the most recent attempt - https://li sts.debian.org/debian-dpkg/2018/05/msg00005.html > > > > Yes, writing regdb as a micro/mini LSM sounds reasonable.  The LSM > > > > would differentiate between other firmware and the regulatory.db based > > > > on the firmware's pathname. > > > > > > If that is the only way then it would be silly to do the mini LSM as all > > > calls would have to have the check. A special LSM hook for just the > > > regulatory db also doesn't make much sense. > > > > All calls to request_firmware() are already going through this LSM > > hook.  I should have said, it would be based on both READING_FIRMWARE > > and the firmware's pathname. > > Yes, but it would still be a strcmp() computation added for all > READING_FIRMWARE. In that sense, the current arrangement is only open coding the > signature verification for the regulatory.db file. One way to avoid this would > be to add an LSM specific to the regulatory db Casey already commented on this suggestion. Mimi > and have the > security_check_regulatory_db() do what it needs per LSM, but that would mean > setting a precedent for open possibly open coded future firmware verification > call. Its not too crazy to consider if an end goal may be avoid further open > coded firmware signature verification hacks. > > > > > Making regdb an LSM would have the same issues as currently - deciding > > > > if regdb, IMA-appraisal, or both verify the regdb's signature. > > > > > > Its unclear to me why they can't co-exist yet and not have to touch > > > the firmware_loader code at all. > > > > With the changes discussed above, they will co-exist.  Other than the > > Kconfig changes, I don't think it will touch the firmware_loader code. > > Great. > > Luis >