Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp338380imm; Thu, 10 May 2018 22:01:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqQ7ywiAc0bdnHSCNFzgCZKdX9XVOzMkXR8Mqln1ZJNmjFOUr8oz1TnWzLCTIhQtL8+qhYG X-Received: by 2002:a63:6d82:: with SMTP id i124-v6mr3279638pgc.249.1526014875445; Thu, 10 May 2018 22:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526014875; cv=none; d=google.com; s=arc-20160816; b=qMjf9ekvXgW1EHcVeXp/7ohVXupO76TAk/dlvA9C/hkLvO8TneN98DFjlUEYuJJqba hP81HXRGOj0IG8Q4qqg8y46/VIXrzuMfpgUvHLVDMg4UCTtdIE4uJ4RuUTTnv6ONyBZX iyjWntivFtfbPAljA7gxJN5mAEzbZwNSG61nZKMmfnoWWprUjHyomytIRx1fPMjZc1X1 hfkeKRrW5UmdKIlTc/OYcEq7xT9CIqV8uXR0Uynauhj6oVkQMDdCFiNssuHq3DuZ0pD4 /5vNBgEN9sxw3ZcxC0D3aO47P5ZXBp432frej+wjmgwH+95kbQvcgYO1TvfY6WkeyDrM GZiA== 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=WugGlV7yx3ik/VKr74n4sAAHmyx3Ei75DcvwJrhwUjQ=; b=vDKjocF4QO1Tus9EL785JMUt21cWJj3mtiRKETJPGwAkyZ8xqjtgiqKahi5ZgzVFg1 HvTYZet42H33Rf+HSEtXJsxwtHNiWaAb+HpK2IJiCgWEox3Om7EcyyLnPlbQKVzd0+H6 CKa1pfGwLot2MpdVAKD8SnkKQ0BtBX1fad0W1velKQdJoSrrcmPC7JzzRQdVLiL3qnC3 bfRpf8N/NpxrPlChjJkfw5ymuVEuy5FW55elB1KuBsVjmwJnju50TD5RGn2GTEuJ7spZ Xd8w3R3m4JZv0NbitssdzbyCxcssAlMpCmVu/h9Kn3GAhqUVnPBZE0GnCf89xnpHT495 rExg== 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 u16-v6si1966546pgv.225.2018.05.10.22.01.00; Thu, 10 May 2018 22:01:15 -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 S1751904AbeEKFAp (ORCPT + 99 others); Fri, 11 May 2018 01:00:45 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58510 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbeEKFAl (ORCPT ); Fri, 11 May 2018 01:00:41 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4B4wp1q145410 for ; Fri, 11 May 2018 01:00:41 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hvxmauvah-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 11 May 2018 01:00:40 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 May 2018 06:00:37 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 11 May 2018 06:00:30 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4B50Ubc66453714; Fri, 11 May 2018 05:00:30 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 35897A404D; Fri, 11 May 2018 05:52:07 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1914A4055; Fri, 11 May 2018 05:52:04 +0100 (BST) Received: from localhost.localdomain (unknown [9.80.108.12]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 11 May 2018 05:52:04 +0100 (BST) Subject: Re: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware From: Mimi Zohar To: "Luis R. Rodriguez" Cc: Matthew Garrett , Peter Jones , "AKASHI, Takahiro" , David Howells , 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: Fri, 11 May 2018 01:00:26 -0400 In-Reply-To: <20180510232639.GF27853@wotan.suse.de> References: <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> <1525917658.3551.322.camel@linux.vnet.ibm.com> <20180510232639.GF27853@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: 18051105-0040-0000-0000-000004585B24 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051105-0041-0000-0000-000020FC6DDE Message-Id: <1526014826.3414.46.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-11_02:,, 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-1805110044 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-05-10 at 23:26 +0000, Luis R. Rodriguez wrote: > On Wed, May 09, 2018 at 10:00:58PM -0400, Mimi Zohar wrote: > > 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: > > > > > > > > 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. > > Sorry but I must have missed this, can you send me the email or URL where he did that? > I never got a copy of that email I think. My mistake.  I've posted similar patches for kexec_load and for the firmware sysfs fallback, both call security_kernel_read_file(). Casey's comment was in regards to kexec_load[1], not for the sysfs fallback mode.  Here's the link to the most recent version of the kexec_load patches.[2] [1] http://kernsec.org/pipermail/linux-security-module-archive/2018-May/006690.html [2] http://kernsec.org/pipermail/linux-security-module-archive/2018-May/006854.html Mimi