From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753486AbdKIRX6 (ORCPT ); Thu, 9 Nov 2017 12:23:58 -0500 Received: from lhrrgout.huawei.com ([194.213.3.17]:39901 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751577AbdKIRXz (ORCPT ); Thu, 9 Nov 2017 12:23:55 -0500 Subject: Re: [PATCH v2 00/15] ima: digest list feature To: Matthew Garrett CC: linux-integrity , , , , , References: <20171107103710.10883-1-roberto.sassu@huawei.com> <899b68a6-fefe-a6db-d624-ea83f597caf1@huawei.com> <210975fe-527c-df2f-5a8a-9aca31e9246a@huawei.com> <738f2f11-02fe-a06a-b7f7-2059951b9f99@huawei.com> From: Roberto Sassu Message-ID: <7bded7a0-fe92-17ba-ff48-c421060d1ccc@huawei.com> Date: Thu, 9 Nov 2017 18:23:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.220.96.228] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.5A048F2A.0031,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d392086e7ca9da2fbadb14e6d9fc2f46 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/9/2017 5:46 PM, Matthew Garrett wrote: > On Thu, Nov 9, 2017 at 11:13 AM, Roberto Sassu wrote: >> On 11/9/2017 3:47 PM, Matthew Garrett wrote: >>> There's no need to have a policy that measures those files, because >>> they're part of the already-measured initramfs. Just set the IMA >>> policy after you've loaded the digest list. >> >> >> The default IMA policy measures files accessed from the initial ram >> disk. It is easier to verify individual files, rather than the whole >> image. > > That's a matter of implementation. You're not forced to use the default policy. > >>> This seems very over-complicated, and it's unclear why the kernel >>> needs to open the file itself. You *know* that all of userland is >> >> >> You can have a look at ima_fs.c. If appraisal is in enforcing mode, >> direct upload of a policy is not permitted. The kernel reads the policy, >> calculates the digest, and verifies the signature. > > Is there an expectation that you'll load additional digest lists at runtime? Yes, before new packages are installed. >>> trustworthy at this point even in the absence of signatures. It seem > >>> reasonable to provide a interface that allows userland to pass a >>> digest list to the kernel, in the same way that userland can pass an >>> IMA policy to the kernel. You can then restrict access to that >>> interface via an LSM. >> >> >> Then digest lists cannot be used alone, without an LSM. Also, verifiers >> have to check the LSM policy to ensure that only the parser was able to >> upload the digest lists. > > Only if you want to add additional digest lists at runtime, but yes, > you really want to be verifying the LSM policy in any case. If the trustworthiness of the initial ram disk can be guaranteed with low effort, for example if the image is distributed by the vendor, it would be easier to guarantee that digest lists were uploaded by the parser. But, likely, the initial ram disk is generated by the local system. Relying on the assumption that the vendor distributes the initial ram disk would limit, in my opinion, the applicability of the digest list feature. Relying on the enforcement by an LSM would make the integrity evaluation much more complex. Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Qiuen PENG, Shengli WANG