Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp773302ybi; Fri, 24 May 2019 11:11:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwic6NH0H/ijZChtow0V4SWqW5vGRSXsU65/KgUuMMvHc4NBx3bTPXzNa6lLeeB/Lehcov X-Received: by 2002:a63:f703:: with SMTP id x3mr104362062pgh.394.1558721505994; Fri, 24 May 2019 11:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558721505; cv=none; d=google.com; s=arc-20160816; b=x8Vyb4hHnOmlvi+PLwqsy0oo2M7GH++ZPJ+Kqhe5F4323lEV5s1F3sQSFMiOFG7oqL vhckU3aj130siU0U4o5cm8FlaIriL4qPGs9G9PT03YtOj+2SANe/O0wQQYSJSK3aR7DQ angGb58RS/ZFidp+3UKfU2xLIkGZeic6ASDp/hpeajzgYg5l33Idci89Fw+FoTjYAv6c Y/zsOjPhNPoisUvArYfhZ4xu7MHRLK7XinzN9LJNhQi7n7/BoQnQ3abIHFURmHXYQ4V4 Ad9oLv6ZJjMCGOl5wEvh8v78m24G1cyytFB4RMlVVUibVSYA0GKyXF6OKdvB4RvsWzeP W62A== 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=ASUfVpUwGDn0bNzsMQSFrajB3HcoVve/7dwQ6FLa9mk=; b=HMNXEKtHMay+HSTNw92wBA+OKGi+T12j2lbxwYeu9wokFY+y3e+NDSZ7Zz2yvVuyB5 fHwWH463GtAxpfGmsKoQYjys7U6BxOs71nDS36hq7fsgUyKnHeM7fHoFMVr28rFlW3MR COhMLqurXgOm1LzDvMMsSTh/47GZMKqQIOkm5q68S+zu+vTlTihWL6wlV8efVfcy3rOn mCl4lSI3ULx1kT5oub8u7MxiYfqTmS8jeyWiwXbbqfLBg+YYu55gpD5SthkE7sbemIhB qZFAYyym7wAdYNTxovNE8vvtg8gbbDJdGWR2gQWeS2NBw1hQCXchcoHVkvj+fLXrd1fo Is9w== 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 1si5023731pln.354.2019.05.24.11.11.30; Fri, 24 May 2019 11:11:45 -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 S1728712AbfEXSJy (ORCPT + 99 others); Fri, 24 May 2019 14:09:54 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50794 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726909AbfEXSJy (ORCPT ); Fri, 24 May 2019 14:09:54 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4OI4KbI003731 for ; Fri, 24 May 2019 14:09:53 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2spn59s175-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 24 May 2019 14:09:52 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 May 2019 19:09:50 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 24 May 2019 19:09:47 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4OI9kK952297748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 May 2019 18:09:46 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D556F4C052; Fri, 24 May 2019 18:09:46 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 053724C046; Fri, 24 May 2019 18:09:46 +0000 (GMT) Received: from dhcp-9-31-103-88.watson.ibm.com (unknown [9.31.103.88]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 24 May 2019 18:09:45 +0000 (GMT) Subject: Re: Re: From: Mimi Zohar To: Roberto Sassu , Prakhar Srivastava , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mjg59@google.com, vgoyal@redhat.com Date: Fri, 24 May 2019 14:09:45 -0400 In-Reply-To: References: <20190521000645.16227-1-prsriva02@gmail.com> <20190521000645.16227-3-prsriva02@gmail.com> <1558710722.3977.68.camel@linux.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: 19052418-0028-0000-0000-000003711A8B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19052418-0029-0000-0000-00002430D182 Message-Id: <1558721385.3977.84.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-24_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 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-1905240117 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> 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. After making a few changes, the measurement list contains the following kexec-cmdline data: 10 edc32d1e3a5ba7272280a395b6fb56a5ef7c78c3 ima-buf sha256:4f43b7db850e 88c49dfeffd4b1eb4f021d78033dfb05b07e45eec8d0b45275  kexec-cmdline 726f6f 743d2f6465762f7364613420726f2072642e6c756b732e757569643d6c756b73 2d6637 3633643737632d653236622d343431642d613734652d62363633636334643832 656120 696d615f706f6c6963793d7463627c61707072616973655f746362 There's probably a better shell command, but the following works to verify the digest locally against the /proc/cmdline: $ echo -n -e `cat /proc/cmdline | sed 's/^.*root=/root=/'` | sha256sum 4f43b7db850e88c49dfeffd4b1eb4f021d78033dfb05b07e45eec8d0b4527f65 - If we leave the "buf" field as ascii-hex, what would the shell command look like when verifying the digest based on the "buf" field? Mimi