Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5666819yba; Mon, 13 May 2019 15:10:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfwWs1fWYnPAyVA+ZAcUml3uCbcFKXbg2H2Ph6t2cb7UWW67B9VbcWjN1O1uR+at81WYt8 X-Received: by 2002:a17:902:8ec6:: with SMTP id x6mr33166385plo.123.1557785434961; Mon, 13 May 2019 15:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557785434; cv=none; d=google.com; s=arc-20160816; b=rD/WTlz+RuLZ9IyMlfsLin0p7hIYNMmfL7rbGJkeF8mnHBNhIfr0L7XTFihtPZ0JWc ndELgidF0pN6wSgtsWNkDjXxHkCOn5fsHF1gcMf1F7gqkm2o10LUMrBzJtu0y/THlZHR 0cIW79HC9GAk+LaJx42MyneObRHLMkctnLU5hmLykABllEn0SQifpyGnTPXbXZtqxDsZ TQ73s+ck1HfXhaSG29FYVSi1jZmnWosL0otwf/G3VhslB/vfdURnF2zWfGO/ssZEE8fy ynlnwWSTw6XNTTaDcKuLU3xL92GQmetdfho10MzeMxlEYzsp9IKPhbaFTxONXQq/chR8 BhuQ== 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; bh=XRLNQrDGYONnU6rJTgT8VfhgbRATLi3eSy21WvHSNH8=; b=B7YQrIIgi6Ids78lgQQLAc11UoGwe0El+m4lEEGeO5bV9NaQ59wSr4NDbLu7ZqKUKi HMTRRhX++ytk86nFJBpSKD1FpqLgJR01xTZ+fvS6oxNFGMx0ZtlgDAXBvdCqYlXNA7+c 4a04dg3bFw/aRr73L6gEOdvZoyXpdjpuSpKIrfbXHIjkNsGgJy3tkIqykXv0EHAo2l0Q XGAf+0ROPI8HWIiyZV0Zd9zr7V/qqB918Quwb7adijN0MFrW/bjQcKaow1PYP3SmxB7D neMN4j3rBGFPw5EXepZNEi4Slik2HerrSrCAUzCetKniF+rfKyZgUN+bPJv7la2o/csF ey3w== 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 61si2760115plb.80.2019.05.13.15.10.19; Mon, 13 May 2019 15:10:34 -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 S1726652AbfEMWJb (ORCPT + 99 others); Mon, 13 May 2019 18:09:31 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41046 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726581AbfEMWJb (ORCPT ); Mon, 13 May 2019 18:09:31 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4DM2hIq130213 for ; Mon, 13 May 2019 18:09:29 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2sffms3au6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 13 May 2019 18:09:29 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 May 2019 23:09:27 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 13 May 2019 23:09:24 +0100 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 x4DM9Np452166906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 May 2019 22:09:23 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 34A1A4C046; Mon, 13 May 2019 22:09:23 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F045D4C044; Mon, 13 May 2019 22:09:21 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.110.120]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 13 May 2019 22:09:21 +0000 (GMT) Subject: Re: [PATCH v2 0/3] initramfs: add support for xattrs in the initial ram disk From: Mimi Zohar To: Arvind Sankar Cc: Arvind Sankar , Roberto Sassu , Rob Landley , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, initramfs@vger.kernel.org Date: Mon, 13 May 2019 18:09:11 -0400 In-Reply-To: <20190513184744.GA12386@rani.riverdale.lan> References: <20190512194322.GA71658@rani.riverdale.lan> <3fe0e74b-19ca-6081-3afe-e05921b1bfe6@huawei.com> <4f522e28-29c8-5930-5d90-e0086b503613@landley.net> <20190513172007.GA69717@rani.riverdale.lan> <20190513175250.GC69717@rani.riverdale.lan> <1557772584.4969.62.camel@linux.ibm.com> <20190513184744.GA12386@rani.riverdale.lan> 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: 19051322-0008-0000-0000-000002E646B0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19051322-0009-0000-0000-00002252DD3F Message-Id: <1557785351.4969.94.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-13_14:,, 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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905130147 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-05-13 at 14:47 -0400, Arvind Sankar wrote: > On Mon, May 13, 2019 at 02:36:24PM -0400, Mimi Zohar wrote: > > > > > > How does this work today then? Is it actually the case that initramfs > > > > just cannot be used on an IMA-enabled system, or it can but it leaves > > > > the initramfs unverified and we're trying to fix that? I had assumed the > > > > latter. > > > Oooh, it's done not by starting IMA appraisal later, but by loading a > > > default policy to ignore initramfs? > > > > Right, when rootfs is a tmpfs filesystem, it supports xattrs, allowing > > for finer grained policies to be defined.  This patch set would allow > > a builtin IMA appraise policy to be defined which includes tmpfs. Clarification: finer grain IMA policy rules are normally defined in terms of LSM labels.  The LSMs need to enabled, before writing IMA policy rules in terms of the LSM labels. > > > Ok, but wouldn't my idea still work? Leave the default compiled-in > policy set to not appraise initramfs. The embedded /init sets all the > xattrs, changes the policy to appraise tmpfs, and then exec's the real > init? Then everything except the embedded /init and the file with the > xattrs will be appraised, and the embedded /init was verified as part of > the kernel image signature. The only additional kernel change needed > then is to add a config option to the kernel to disallow overwriting the > embedded initramfs (or at least the embedded /init). Yes and no.  The current IMA design allows a builtin policy to be specified on the boot command line ("ima_policy="), so that it exists from boot, and allows it to be replaced once with a custom policy.  After that, assuming that CONFIG_IMA_WRITE_POLICY is configured, additional rules may be appended.  As your embedded /init solution already replaces the builtin policy, the IMA policy couldn't currently be replaced a second time with a custom policy based on LSM labels. Mimi