Received: by 10.192.165.148 with SMTP id m20csp4956026imm; Tue, 1 May 2018 06:51:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrU97v+hkqM+BUOt2xIkM9zux62FLm7eBb1C8Q9Mo0uddlH+8GqztRaFlsY9JBrEodGpoge X-Received: by 10.98.224.76 with SMTP id f73mr15826781pfh.88.1525182676594; Tue, 01 May 2018 06:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525182676; cv=none; d=google.com; s=arc-20160816; b=zq5HoJnqeiAooJbR7Gmi9UD8JEIzv9haAzU4xOrTbOQzkWJZRKc2bsu2JPFuq+riD3 dr3h08EXZ0s6vQW/Z+dSEUAflkwcr17rI4aLhmz78wvWvnLs6HdCYeqr0a25IN/MYwzd Ica+tphE1c/jgNiMhK+7//na/bZhm8kJHb2O6E51ZWwQFLBQUqTAtfiHAn5c0FTMXaKq pVOdaAKpCmN2pYNzwfqPeGNevP4qb+0FyLKsl5qO7s1HzF9oMrZCU6jHb7AdigPyYeTX l7Yj4jp/2d9vuROFGYQ/Qk5oHHmv8330EcjeE3XQhZ7XIy7WhxaPYlBB9TBpaASFFL6k OrUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=J16PCqHO/yw9wpdN0yX7b+4uu/f+TMfghKbQvgwcKSs=; b=Gep89RoHQyHcAliWQl/OaawSuncYIIlxBRS35d8yrn3zOqvviH0v7AVi2cdck5UkzC 3dF43hYRg/8eKaoIFkkM8PDdzChCHkQiZ7GIm25pbea47hpysMnyxTJ1iayGUgvGRmGX ju7HPxQY9YSNmlrd0x2QAmfHjx/0eLHbgN1KHtAUccSBr6feBKrG2MjWEcMGyqvrISxS WKRrtZKGbrKx5oa1w8RsKtqhrgrqRn2q4KIGiQ6ghR1ziL0Z+Xni8ivrqiUQtNGAs0j1 0ZdyhEp3cbWog0e9l1IRSM/ITbZcBXV1K9ykk1dMm2QP/ChF3kWQM8u0z18++elrLQiR ZXbQ== 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 b62-v6si7749726pgc.505.2018.05.01.06.51.02; Tue, 01 May 2018 06:51: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755694AbeEANsw (ORCPT + 99 others); Tue, 1 May 2018 09:48:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42178 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754340AbeEANsr (ORCPT ); Tue, 1 May 2018 09:48:47 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w41DiVm7132378 for ; Tue, 1 May 2018 09:48:47 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hphst6d3b-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 01 May 2018 09:48:46 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 May 2018 14:48:45 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 1 May 2018 14:48:40 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w41DmeRd11272514; Tue, 1 May 2018 13:48:40 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 696FD42042; Tue, 1 May 2018 14:39:53 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C257142041; Tue, 1 May 2018 14:39:51 +0100 (BST) Received: from localhost.ibm.com (unknown [9.80.105.194]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 1 May 2018 14:39:51 +0100 (BST) From: Mimi Zohar To: linux-integrity@vger.kernel.org Cc: Hans de Goede , Ard Biesheuvel , Peter Jones , Mimi Zohar , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, David Howells , "Luis R . Rodriguez" , "Luis R . Rodriguez" , Kees Cook , Seth Forshee , Johannes Berg Subject: [PATCH 3/6] firmware: differentiate between signed regulatory.db and other firmware Date: Tue, 1 May 2018 09:48:20 -0400 X-Mailer: git-send-email 2.7.5 In-Reply-To: <1525182503-13849-1-git-send-email-zohar@linux.vnet.ibm.com> References: <1525182503-13849-1-git-send-email-zohar@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18050113-0040-0000-0000-00000434CD9E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18050113-0041-0000-0000-00002638E687 Message-Id: <1525182503-13849-4-git-send-email-zohar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-01_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 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-1805010138 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow LSMs and IMA to differentiate between signed regulatory.db and other firmware. Signed-off-by: Mimi Zohar Cc: Luis R. Rodriguez Cc: David Howells Cc: Kees Cook Cc: Seth Forshee Cc: Johannes Berg --- drivers/base/firmware_loader/main.c | 5 +++++ include/linux/fs.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index eb34089e4299..d7cdf04a8681 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -318,6 +318,11 @@ fw_get_filesystem_firmware(struct device *device, struct fw_priv *fw_priv) break; } +#ifdef CONFIG_CFG80211_REQUIRE_SIGNED_REGDB + if ((strcmp(fw_priv->fw_name, "regulatory.db") == 0) || + (strcmp(fw_priv->fw_name, "regulatory.db.p7s") == 0)) + id = READING_FIRMWARE_REGULATORY_DB; +#endif fw_priv->size = 0; rc = kernel_read_file_from_path(path, &fw_priv->data, &size, msize, id); diff --git a/include/linux/fs.h b/include/linux/fs.h index dc16a73c3d38..d1153c2884b9 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2811,6 +2811,7 @@ extern int do_pipe_flags(int *, int); id(FIRMWARE, firmware) \ id(FIRMWARE_PREALLOC_BUFFER, firmware) \ id(FIRMWARE_FALLBACK, firmware) \ + id(FIRMWARE_REGULATORY_DB, firmware) \ id(MODULE, kernel-module) \ id(KEXEC_IMAGE, kexec-image) \ id(KEXEC_INITRAMFS, kexec-initramfs) \ -- 2.7.5