Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7100574ybi; Thu, 13 Jun 2019 09:33:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSsNDwgQBnMpFs6kYJI6ypDOzuWhL8a25zitUke8gedhmtETzqVT63mZ8+/jWDv1aAbWHp X-Received: by 2002:a17:902:b696:: with SMTP id c22mr85099468pls.119.1560443595830; Thu, 13 Jun 2019 09:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560443595; cv=none; d=google.com; s=arc-20160816; b=CAnVpZ2z31LEJ4qTysbjLMTX1NrtbrNs9rAe+GmAxm1nMZqfX5zV5TZIrpmySAMEM1 MXcACu7XbmZyxMYNHAP/cXwL6ZeXrcj3wg98af7GIYA8vP0VfRRaTPCxgAqjVJYNZkAi OLY8onux9338joZOVhSg/hLkgPdOUrrxtqkGKTLPEPlzwDAOR0c2Rm8IJn/6AKDCJHdJ gD41AkLiqzQ7QQ033RC+EewVuelh/VTe882Vk+PsL07ctKe/cnjfwYUtUnt8fz0XGIzt /qOvNnqElr07ozy9GrApcmX3vonK9gOQEy2OystaYCaSudzvGjaTdblLnrhoWlRrJrmm FvQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MjmRp19mPHPimB9AEpDzOonfYD5lb4c9pi+943qeJi0=; b=rqZzSYbrcy/4OmY+h4dC4aZi0WIjRTlyp8XGw2Mk1UMDq02ht0FAHRhxVouJsHPiTz iUeEWcK8UqmnHW9FXN5ApaASgtdGSc6T8uT3nEHd5SP0CVIfZGIBy7EOCp2gfIPmVSp0 zaUTNFml8cSYcPZJOnYHLpzNOcq5T5uTWMh3zBHHlmpl3wlkblWBrEld11voW0FxVnke a8oMzrWdxLZzKho77PwfZxflPF44T/O1KrpnjEy5ysutpnTMe5vEDiTpv23531FImVnC k8cjkU3B/1b32cADuYVGMiFSPQ1D6TFLJkkGSX0QyeUgcHEkhfqKT8YxNwIHbYSYwZ5c 3OWw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si140004pgs.135.2019.06.13.09.33.00; Thu, 13 Jun 2019 09:33:15 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730878AbfFMQbZ (ORCPT + 99 others); Thu, 13 Jun 2019 12:31:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59694 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730876AbfFMI0k (ORCPT ); Thu, 13 Jun 2019 04:26:40 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73FF830860C0; Thu, 13 Jun 2019 08:26:39 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-87.pek2.redhat.com [10.72.12.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E3E960FB1; Thu, 13 Jun 2019 08:26:31 +0000 (UTC) Date: Thu, 13 Jun 2019 16:26:27 +0800 From: Dave Young To: Mimi Zohar Cc: Prakhar Srivastava , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, roberto.sassu@huawei.com, "Eric W. Biederman" , vgoyal@redhat.com, kexec Subject: Re: [PATCH V8 3/3] Call ima_kexec_cmdline to measure the cmdline args Message-ID: <20190613082627.GA30288@dhcp-128-65.nay.redhat.com> References: <20190612221549.28399-1-prsriva02@gmail.com> <20190612221549.28399-4-prsriva02@gmail.com> <1560378703.4578.91.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1560378703.4578.91.camel@linux.ibm.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 13 Jun 2019 08:26:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/12/19 at 06:31pm, Mimi Zohar wrote: > [Cc: kexec mailing list] > > Hi Eric, Dave, > > On Wed, 2019-06-12 at 15:15 -0700, Prakhar Srivastava wrote: > > During soft reboot(kexec_file_load) boot cmdline args > > are not measured.Thus the new kernel on load boots with > > an assumption of cold reboot. > > > > This patch makes a call to the ima hook ima_kexec_cmdline, > > added in "Define a new IMA hook to measure the boot command > > line arguments" > > to measure the boot cmdline args into the ima log. > > > > - call ima_kexec_cmdline from kexec_file_load. > > - move the call ima_add_kexec_buffer after the cmdline > > args have been measured. > > > > Signed-off-by: Prakhar Srivastava > Cc: Eric W. Biederman > Cc: Dave Young > > Any chance we could get some Acks? The ima_* is blackbox functions to me, looks like this patch is trying to measure kexec cmdline buffer and save in some ima logs and then add all the measure results including those for kernel/initrd to a kexec_buf and pass to 2nd kernel. It should be good and only take effect when IMA enabled. If all the assumptions are right: Acked-by: Dave Young > > thanks, > > Mimi > > > --- > > kernel/kexec_file.c | 9 ++++++--- > > 1 file changed, 6 insertions(+), 3 deletions(-) > > > > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c > > index 072b6ee55e3f..b0c724e5d86c 100644 > > --- a/kernel/kexec_file.c > > +++ b/kernel/kexec_file.c > > @@ -198,9 +198,6 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, > > return ret; > > image->kernel_buf_len = size; > > > > - /* IMA needs to pass the measurement list to the next kernel. */ > > - ima_add_kexec_buffer(image); > > - > > /* Call arch image probe handlers */ > > ret = arch_kexec_kernel_image_probe(image, image->kernel_buf, > > image->kernel_buf_len); > > @@ -241,8 +238,14 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, > > ret = -EINVAL; > > goto out; > > } > > + > > + ima_kexec_cmdline(image->cmdline_buf, > > + image->cmdline_buf_len - 1); > > } > > > > + /* IMA needs to pass the measurement list to the next kernel. */ > > + ima_add_kexec_buffer(image); > > + > > /* Call arch image load handlers */ > > ldata = arch_kexec_kernel_image_load(image); > > > > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec Thanks Dave