Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp382641pxk; Fri, 11 Sep 2020 09:25:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6aQmm0fg0IYcS+dVVBRtz43NZ49/IL6vshqaTLnyp4OIQubq6Gvx8Oi4dYil6okYxOwPl X-Received: by 2002:a17:906:4956:: with SMTP id f22mr2677648ejt.62.1599841506161; Fri, 11 Sep 2020 09:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599841506; cv=none; d=google.com; s=arc-20160816; b=As5F4VktsBSb6MA1NOGnXVkdCj3ey+iob/OlZcD9vjjPnzdKLBI7/kHp0kZ8w54sdN KaL0xtx/y0wWeNtA1bCi2q0DH/uOWqGmbeyNSevrwI/OustpP5LFplqqUEIeR1arEIrz w9WA5qSM64PK3IUmjSjFDsMBc5e/6Jwbllu31uMZxaMz1/QkUN1H5sFR9519KOEUgzTz BhboX4NwRiHecwi5ycZhRjiZsCk+3/OwNi5u9g/WAlYhdSl8oZP1do4lrGFlBa/7K99i lSD4XUyi59Ed8aTWt/nDgAlp719ueVrEhnrJaihKs50d/Du/T9QJTgXPHq/ALTWRxG8l +Bmw== 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:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=Su6m0M3GjOhlI1z/NUkRmKtJzGmhY9DfdpjSMQkRt4Y=; b=YpF/FBUriA6vciG/mwvqZ0eKV8UMkJhSGHaT4N/+4T6Tz9AogyoYUfpIhJQMwmLEcl aHRINjG8JvsxDQgsndhRC+jdUktx1MqwIFalx2xcOKm1dulT0L0nNss1iaHojw9eCPBi wL7nug/8KTOuZcnfcfgOdXQ1sSCbLdTIwOvt2m0ovxdOAhSofwlJxB1s8ciLHAnsXciJ S0KtmYdfVwHqGi2bzO4XFlj9cgmPSe4tIyc29Hh2WdB34oZ4v43m+EmQTFIEb9Snfwld 7H/6xz/4MRPi0eFx2EgOsKztfFpazwuf1GuFTl/7J880HZUWBsbn6nhMRRffLTz33AFi GGJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=icn5YDih; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si1584920edt.464.2020.09.11.09.24.43; Fri, 11 Sep 2020 09:25:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=icn5YDih; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726399AbgIKQXQ (ORCPT + 99 others); Fri, 11 Sep 2020 12:23:16 -0400 Received: from linux.microsoft.com ([13.77.154.182]:59396 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbgIKQWp (ORCPT ); Fri, 11 Sep 2020 12:22:45 -0400 Received: from [192.168.86.21] (c-71-197-163-6.hsd1.wa.comcast.net [71.197.163.6]) by linux.microsoft.com (Postfix) with ESMTPSA id 953AD20716FC; Fri, 11 Sep 2020 09:22:44 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 953AD20716FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1599841365; bh=Su6m0M3GjOhlI1z/NUkRmKtJzGmhY9DfdpjSMQkRt4Y=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=icn5YDihH4nELQOa8XNaTtjLDKp8AAuHVuJp46dNGCfren5N/F4OyEY0zubNe4Afz AU1se4eyggNhCjrdVqxdR65dpaLxKCZ3iPAt3S8r3n0Uj0kyoOZhfysoGyK3jNvgpt HpvqV+kp8zkc9lqaawhKse8yHKUq5PidqsO1b9tA= Subject: Re: [PATCH v3 2/6] IMA: change process_buffer_measurement return type from void to int To: Mimi Zohar , stephen.smalley.work@gmail.com, casey@schaufler-ca.com, agk@redhat.com, snitzer@redhat.com, gmazyland@gmail.com Cc: tyhicks@linux.microsoft.com, sashal@kernel.org, jmorris@namei.org, nramas@linux.microsoft.com, linux-integrity@vger.kernel.org, selinux@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com References: <20200828015704.6629-1-tusharsu@linux.microsoft.com> <20200828015704.6629-3-tusharsu@linux.microsoft.com> From: Tushar Sugandhi Message-ID: Date: Fri, 11 Sep 2020 09:22:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-08-31 4:36 a.m., Mimi Zohar wrote: > On Thu, 2020-08-27 at 18:57 -0700, Tushar Sugandhi wrote: >> process_buffer_measurement() does not return the result of the operation. >> Therefore, the consumers of this function cannot act on it, if needed. >> >> Update return type of process_buffer_measurement() from void to int. > > Failure to measure may be audited, but should never fail. This is one > of the main differences between secure and trusted boot concepts. > Notice in process_measurement() that -EACCES is only returned for > appraisal. > > Returning a failure from process_buffer_measurement() in itself isn't a > problem, as long as the failure isn't returned to the LSM/IMA hook. > However, just as the callers of process_measurement() originally > processed the result, that processing was moved into > process_measurement() [1]. > > Mimi > > [1] 750943a30714 ima: remove enforce checking duplication > I can ignore the result of process_buffer_measurement() in ima_measure_critical_data(), and make ima_measure_critical_data() return type "void". But currently ima_measure_critical_data() is the only place where the results of p_b_m() are being used. So I might as well just revert back the return type of p_b_m() to the original "void".