Received: by 10.223.164.221 with SMTP id h29csp2516435wrb; Thu, 2 Nov 2017 12:14:53 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RqWqTp256yv8M0to574MxQFtc31TKZAdaNyrWn5enRpqHRe9qgYgxJlzsR1lb7GgOy41wk X-Received: by 10.84.241.15 with SMTP id a15mr4333697pll.199.1509650093170; Thu, 02 Nov 2017 12:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509650093; cv=none; d=google.com; s=arc-20160816; b=bmM8B5bkwfjS8AOClVfQImVYYykjY87zD4IN1oN3RDDIJJPf/CEH6AWp+k4cwGOrZ2 BF4ioLczElmoZaJG5nMeGBmok7H06xDlCRedBXXqrJRyPw6lgHXqs3e7i0WK1k8XroQN v69DMf5gYCrPKsKQ1okhd1ZbDI7TT4lvtLdWXjH1Vw03MRKiQ+v+KU2jTNOSjFCs2Tjj koxM0+88A0KTRYE3Y05jdj0zxOg8eIGM+9VNAphRJ38kgE43k2OYNLvF/rtOEf5ROewJ Hmw8XmbcsUi2AgSuMqxPSXhd+oiC8Fqp+Bju5TK1DHbemlizUg42iMUoHLcCDmnDweDm ML+w== 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=MCBYF89xPvm+KbcS9+3hgHzseNWhMAyz6x6WYVGdteo=; b=0IJLVIRJAxFf152hMe8N9xTVo8Wgob/vovACQB9ZtuWgiGBHfN66d6E5AoThgrrt39 +tTK2o7nuz5M93O/jmRW237w7zlE6JQ/aBIBqHpxoyfGtYF6q7T3hOAvIJBQiGHGZdKG JM8GEPHM0X+k+Ad+o9pE36JAzherjhjJImLJgMkQM6i1m8g4soNDRRcB+nFQtkG8anF6 eJk8zMLf+iZlxPWtfyLaVUhh5q+vS3JAzyqdhHPhjJLD/1P6P0taHi2uNIx+4n5bqXwt tMHfkwpM7Oo9C4jjZXZm+Pj60iyBaTAS7/Z1P4eLX+p0cylOIKpJh/P54jDlygNBa4r/ TBMw== 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 o5si4450775pfh.412.2017.11.02.12.14.40; Thu, 02 Nov 2017 12:14:53 -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 S934356AbdKBTOI (ORCPT + 97 others); Thu, 2 Nov 2017 15:14:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35136 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932571AbdKBTOA (ORCPT ); Thu, 2 Nov 2017 15:14:00 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA2JAZ5p093885 for ; Thu, 2 Nov 2017 15:14:00 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e08kp2g09-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 02 Nov 2017 15:13:59 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Nov 2017 19:13:57 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 2 Nov 2017 19:13:54 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA2JDr4E27590846; Thu, 2 Nov 2017 19:13:53 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7012C4C050; Thu, 2 Nov 2017 19:09:21 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60EE74C04A; Thu, 2 Nov 2017 19:09:20 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.111.109]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 2 Nov 2017 19:09:20 +0000 (GMT) Subject: Re: [PATCH 03/27] Enforce module signatures if the kernel is locked down From: Mimi Zohar To: David Howells Cc: linux-security-module@vger.kernel.org, gnomes@lxorguk.ukuu.org.uk, linux-efi@vger.kernel.org, matthew.garrett@nebula.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, jforbes@redhat.com Date: Thu, 02 Nov 2017 15:13:51 -0400 In-Reply-To: <20240.1509643356@warthog.procyon.org.uk> References: <1509130095.3716.13.camel@linux.vnet.ibm.com> <150842463163.7923.11081723749106843698.stgit@warthog.procyon.org.uk> <150842465546.7923.6762214527898273559.stgit@warthog.procyon.org.uk> <20240.1509643356@warthog.procyon.org.uk> 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: 17110219-0040-0000-0000-000003E9E1BD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110219-0041-0000-0000-000025EC6E5A Message-Id: <1509650031.3507.20.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-02_07:,, 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-1707230000 definitions=main-1711020233 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-11-02 at 17:22 +0000, David Howells wrote: > #ifdef CONFIG_MODULE_SIG > -static int module_sig_check(struct load_info *info, int flags) > +static int module_sig_check(struct load_info *info, int flags, > + bool can_do_ima_check) > { > int err = -ENOKEY; > const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1; > @@ -2781,13 +2783,16 @@ static int module_sig_check(struct load_info *info, int flags) > } > > /* Not having a signature is only an error if we're strict. */ > - if (err == -ENOKEY && !sig_enforce) > + if (err == -ENOKEY && !sig_enforce && > + (!can_do_ima_check || !is_ima_appraise_enabled()) && > + !kernel_is_locked_down("Loading of unsigned modules")) By this point, IMA-appraisal has already verified the kernel module signature back in kernel_read_file_from_fd(), if it was required.  Having a key with which to verify the appended signature or requiring an appended signature, should not be required as well. Mimi From 1582975848619327419@xxx Thu Nov 02 17:23:30 +0000 2017 X-GM-THRID: 1581705993536835286 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread