Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp622394ybi; Fri, 24 May 2019 08:48:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7dzN7n6E7jM3prb0rjAdD8vYrL08OSEGWCR8VKiqSiXTX6wWlqR5g8gkmZYLg47F6DQ0c X-Received: by 2002:a62:4c5:: with SMTP id 188mr53591127pfe.19.1558712921677; Fri, 24 May 2019 08:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558712921; cv=none; d=google.com; s=arc-20160816; b=OLlbjObm8TUWnPNB7uWOxMhbYVyxtnDoYMEJTGENHbfp8BGlelUIvNGETFVaZ2dz/L y4CP5nnFYphIsF2ScIPJMERAKMhLQ2vXwt48Rx0NGVqP5BgqpPRijKOdSwACOLbKPbaF 1uTgng8KY87KGuU0haRvWGR6bgiTHMQBfQQ5iRSz714Mp+1QeFXUStsbsZEem37OVmp1 8vvILM1e/B8CYfCpzEphHYSBacMls/5wY8GckpjTQpSa8kQ2EUE3qnaTZuA88NL6xUY/ VWVRrSgzpA1hyefn2WLeZ/aIPM6RyKyPdY1Go/I2AbBQIpaza4Znxz7x1cavL4hNmPit usDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=zDHiXKpqTIT4fqVJOILGTovr/JsA1rWO6fr71RxRak0=; b=H/AhcCP8s9o9sy8mkD69P1gbd8+ESvUCVQbUAiRolkfvWfCZg0HE5GJJNwli8+ByZ6 WlIz8jIlIwDgNBGMzWbAm/LHJ5q3R6q+/Gv3YnuBUV8GpmZCOEbooFES2sakLXyyAXdi 9TMESxhf5HWI0FExMH6kJuCyiJS5ovBahc7HKTJQRUwRQSXvUMygwPhzZLU9g1oiId8M 6+tacKP43vSbIuLO+k5puKgqAlFwk1BARtiU8XeV+Ch+905lWWMWWYh2HZPI66D8uYQc 2Puv5yUr2rGkrCbTwx0lX7zaBkxovg3h+9Pctp/omWqA0S0KOrm5ep53y63mxguxh8eB UAqw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24si4900945pgj.18.2019.05.24.08.48.24; Fri, 24 May 2019 08:48:41 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389964AbfEXPrB (ORCPT + 99 others); Fri, 24 May 2019 11:47:01 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:32969 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389079AbfEXPrA (ORCPT ); Fri, 24 May 2019 11:47:00 -0400 Received: from LHREML711-CAH.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 27C5215AA8D2C4377753; Fri, 24 May 2019 16:46:59 +0100 (IST) Received: from [10.204.65.201] (10.204.65.201) by smtpsuk.huawei.com (10.201.108.34) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 24 May 2019 16:46:57 +0100 Subject: Re: From: Roberto Sassu To: Mimi Zohar , Prakhar Srivastava , , , CC: , References: <20190521000645.16227-1-prsriva02@gmail.com> <20190521000645.16227-3-prsriva02@gmail.com> <1558710722.3977.68.camel@linux.ibm.com> Message-ID: Date: Fri, 24 May 2019 17:47:05 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.204.65.201] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/2019 5:42 PM, Roberto Sassu wrote: > On 5/24/2019 5:12 PM, Mimi Zohar wrote: >> On Mon, 2019-05-20 at 17:06 -0700, Prakhar Srivastava wrote: >>> A buffer(cmdline args) measured into ima cannot be appraised >>> without already being aware of the buffer contents.Since we >>> don't know what cmdline args will be passed (or need to validate >>> what was passed) it is not possible to appraise it. >>> >>> Since hashs are non reversible the raw buffer is needed to >>> recompute the hash. >>> To regenrate the hash of the buffer and appraise the same >>> the contents of the buffer need to be available. >>> >>> A new template field buf is added to the existing ima template >>> fields, which can be used to store/read the buffer itself. >>> Two new fields are added to the ima_event_data to carry the >>> buf and buf_len whenever necessary. >>> >>> Updated the process_buffer_measurement call to add the buf >>> to the ima_event_data. >>> process_buffer_measurement added in "Add a new ima hook >>> ima_kexec_cmdline to measure cmdline args" >>> >>> - Add a new template field 'buf' to be used to store/read >>> the buffer data. >>> - Added two new fields to ima_event_data to hold the buf and >>> buf_len [Suggested by Roberto] >>> -Updated process_buffer_meaurement to add the buffer to >>> ima_event_data >> >> This patch description can be written more concisely. >> >> Patch 1/3 in this series introduces measuring the kexec boot command >> line.  This patch defines a new template field for storing the kexec >> boot command line in the measurement list in order for a remote >> attestation server to verify. >> >> As mentioned, the first patch description should include a shell >> command for verifying the digest in the kexec boot command line >> measurement list record against /proc/cmdline.  This patch description >> should include a shell command showing how to verify the digest based >> on the new field.  Should the new field in the ascii measurement list >> be displayed as a string, not hex? > > We should define a new type. If the type is DATA_FMT_STRING, spaces are > replaced with '_'. Or better. Leave it as hex, otherwise there would be a parsing problem if there are spaces in the data for a field. Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Jian LI, Yanli SHI