Received: by 10.192.165.156 with SMTP id m28csp1850712imm; Thu, 12 Apr 2018 04:45:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx497rbG1OtMSpQZeYHeOTzADxVu8cIvJQIASlD6ZFIGWJB/VSGhY2Pz/iIczZSXl7OY1k8YT X-Received: by 2002:a17:902:70c6:: with SMTP id l6-v6mr645753plt.201.1523533501830; Thu, 12 Apr 2018 04:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523533501; cv=none; d=google.com; s=arc-20160816; b=FK1ODDf/bC/0cZSaswVWznweXbQMu59VIgf0m0Z5ddHeLAXVzlcoj+s9fJ6CpmXV5l 5OP84+4dBaKM7C+9m6iJM4E0Krz3/1qMPeh2b8zQOdebLBDxRKnFeIAuS7SjMX7PqNfb FbOPdAdiRj7JeuYTJc4OJHjDbhMmfxNiNAjD6CRQilBU1CRA3y9JPFcKpFOSe1eXl6pU ykzTazgJuElSADR0uq0cOJNhWl1PJYrbt6Dc3Sb9/R+tcrL3f8vK6Pdy+xwFg/nOag6x YKjQ3qkh+K2+E7sYs2eyMJtMsSedYyqVeiBMTD7R4tuA12OihKr6ddSOCg2OPBmTfReY mWUw== 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=E38X6Pq8E+B4gFyz6dsb2GxrPRpIICVJ0y29J3R8qIc=; b=Ej1J3zxTPu2AkrrJ8W1EyDH0VqWLDhYOSE0UBT/hq8tsT0aImcLGOETVR3Sblh+jQN AYSwb6S6xquW5CquFj/YGJVnVrp/0Uw/g/IRaipvIC2Bsw6OgUblQwa6IX2Nf4E+Mf8O yPSh2EJm/6TzMbfp7LUIPPlrGIfmSULvsuCllEUPIxVnIxtO6Rmbld/7YYjpj25g2hKV AKt6JarojuCsFpUGvLitCH1LXcoOy9KLcBRdClxvLRCOL+e/9vy4KAGLBIqtPnOdlbKZ mCYGRQrZf1fzfPnxxF79LC7YDa3HSafe3u0ZwECwMbSFqfOJ+eLu0LDeK1Iuqm/RBLQJ 2wVg== 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 g8si2072474pgq.544.2018.04.12.04.44.24; Thu, 12 Apr 2018 04:45:01 -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 S1752437AbeDLLi1 (ORCPT + 99 others); Thu, 12 Apr 2018 07:38:27 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38640 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751832AbeDLLiZ (ORCPT ); Thu, 12 Apr 2018 07:38:25 -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 w3CBYxcB018404 for ; Thu, 12 Apr 2018 07:38:25 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ha6761kra-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 12 Apr 2018 07:38:24 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Apr 2018 12:38:22 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 12 Apr 2018 12:38:19 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3CBcJGO56360998; Thu, 12 Apr 2018 11:38:19 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 766D1AE045; Thu, 12 Apr 2018 12:28:14 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B667AE051; Thu, 12 Apr 2018 12:28:13 +0100 (BST) Received: from localhost.localdomain (unknown [9.80.105.89]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 12 Apr 2018 12:28:13 +0100 (BST) Subject: Re: [PATCH 06/24] kexec_load: Disable at runtime if the kernel is locked down From: Mimi Zohar To: "Eric W. Biederman" , David Howells Cc: torvalds@linux-foundation.org, linux-man@vger.kernel.org, linux-api@vger.kernel.org, jmorris@namei.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Date: Thu, 12 Apr 2018 07:38:17 -0400 In-Reply-To: <1523477375.5268.78.camel@linux.vnet.ibm.com> References: <152346387861.4030.4408662483445703127.stgit@warthog.procyon.org.uk> <152346391877.4030.6270466586590461223.stgit@warthog.procyon.org.uk> <87po35k1q6.fsf@xmission.com> <1523477375.5268.78.camel@linux.vnet.ibm.com> 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: 18041211-0040-0000-0000-0000042D7CFB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18041211-0041-0000-0000-00002631958B Message-Id: <1523533097.31852.11.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-12_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-1709140000 definitions=main-1804120119 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-04-11 at 16:09 -0400, Mimi Zohar wrote: > On Wed, 2018-04-11 at 14:00 -0500, Eric W. Biederman wrote: > > David Howells writes: > > > > > From: Matthew Garrett > > > > > > The kexec_load() syscall permits the loading and execution of arbitrary > > > code in ring 0, which is something that lock-down is meant to prevent. It > > > makes sense to disable kexec_load() in this situation. > > > > > > This does not affect kexec_file_load() syscall which can check for a > > > signature on the image to be booted. > > > > Maybing I am missing it but I am not seeing anything that would require > > kexec_file_load be configured such that it checks the loaded kernel. > > > > Without that I don't see the point of disabling kexec_load. > > > > Nacked-by: "Eric W. Biederman" > > The IMA "secure boot" policy requires the kexec image to be signed. >  This call to kernel_is_locked_down() could be replaced with a call > to security_kernel_read_file(NULL, READING_KEXEC_IMAGE). > > It would be similar to the existing init_module syscall calling > security_kernel_read_file(). David, enabling the IMA-appraisal "secure boot" policy should probably not be dependent on lockdown either. Mimi