Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2569856ybt; Tue, 16 Jun 2020 09:15:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKM6b4PTX8vayX4RoIxXaWsIDiC0KoUK+wLMOp6I7LBUWZj8WcTkRisn9ccNuG05+SOMY3 X-Received: by 2002:a17:906:689:: with SMTP id u9mr3400197ejb.13.1592324103829; Tue, 16 Jun 2020 09:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592324103; cv=none; d=google.com; s=arc-20160816; b=szr3Guji5QGFlO0caj+VxFJS/rab4D48GoJo/DIBOaQWOqHJrz9Pl7bmBxurch350d 8CuFdhStxSQHPNZJrY38Gr22IEeh3RWdtcPe7L/rfja077v0eyAJ/aU6XEb0zrqVv9DT wSk0KHrdk53szw9i2Dq/C2fStO5ojgzhZy5ysXvWnpKDL7klqvvT2mN8for/ZxHVk3cw T1DQWcRu7M14/sWXaMadL4GqpT6wMTN/gKiLPEtIdDBoC7UG2LafKR4m7tVJpRwHPF6j 2eno6TvQcxEo9l7ycuKELsUi0C1cMGcNHz24fTlR3DYxESQaoGmU5vxou5c7NLZ2K6R3 ImQg== 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=RynDn+a/ofKU7OdV/8LbyELxOuKAdSPTNjMGDzeL//0=; b=fQJgqJBx9JwJIC1uYznkvAYqq+wL8Xgq/fQLuZTU/XjMNXlFJGZAFiHT9i23RuNeCV U+5xl3VPwArRfpm/E6pZuD1J1ucSWHE9b1iPmOV4DwdAmUjkCa9oIGjoCnLr0PSWQNOa QCShZLkbIBDsOMz+TRNE4djWjmZgI+Ck97QYXnawdDmXW7FNKefisNShLqtOlEiD8+y7 hTRBVpM4GS5ALmq8+AKGYKmg+OgRlPFOXQPGqKTvmjdXCswc6aJEZddNOLq3badSHs+b tMirBa1spk3xw+w799E88WT2qFg45koPGjuQqToFenGyWHLRF+VzqABgh28Acvu11CAU zURA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=UHO6ZtVx; 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 w17si12077026ejn.590.2020.06.16.09.14.41; Tue, 16 Jun 2020 09:15:03 -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=UHO6ZtVx; 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 S1731823AbgFPPnh (ORCPT + 99 others); Tue, 16 Jun 2020 11:43:37 -0400 Received: from linux.microsoft.com ([13.77.154.182]:54540 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731812AbgFPPnc (ORCPT ); Tue, 16 Jun 2020 11:43:32 -0400 Received: from [192.168.0.104] (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id C084620B4780; Tue, 16 Jun 2020 08:43:31 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C084620B4780 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1592322211; bh=RynDn+a/ofKU7OdV/8LbyELxOuKAdSPTNjMGDzeL//0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=UHO6ZtVxj39eqvlVM44GPhHNLb5TrHlvXCgGPBbLz/yR2e0oli1hzCERttTv4pLZG uNRmbxDkaMjDoGJUVqiKyWCeGuNs3whJthdOoaC+Iz8bdBslIpnJIAteXKKgrkY1H3 OeL14WdFa3WSwXF68arcCq2glFGGQDE9Mm/LqXq0= Subject: Re: [PATCH 1/2] integrity: Add errno field in audit message To: Steve Grubb , Paul Moore Cc: Mimi Zohar , rgb@redhat.com, linux-integrity@vger.kernel.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org References: <20200611000400.3771-1-nramas@linux.microsoft.com> <8800031.dr63W5FlUW@x2> <6643272.rC52FQZPYE@x2> From: Lakshmi Ramasubramanian Message-ID: <958966b6-9972-051f-a7d5-cd6d1beb3244@linux.microsoft.com> Date: Tue, 16 Jun 2020 08:43:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <6643272.rC52FQZPYE@x2> Content-Type: text/plain; charset=utf-8; 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 6/16/20 8:29 AM, Steve Grubb wrote: >>>>> The idea is a good idea, but you're assuming that "result" is always >>>>> errno. That was probably true originally, but isn't now. For >>>>> example, ima_appraise_measurement() calls xattr_verify(), which >>>>> compares the security.ima hash with the calculated file hash. On >>>>> failure, it returns the result of memcmp(). Each and every code path >>>>> will need to be checked. >>>> >>>> Good catch Mimi. >>>> >>>> Instead of "errno" should we just use "result" and log the value given >>>> in the result parameter? >>> >>> That would likely collide with another field of the same name which is >>> the >>> operation's results. If it really is errno, the name is fine. It's >>> generic >>> enough that it can be reused on other events if that mattered. >> >> Steve, what is the historical reason why we have both "res" and >> "result" for indicating a boolean success/fail? I'm just curious how >> we ended up this way, and who may still be using "result". > > I think its pam and some other user space things did this. But because of > mixed machines in datacenters supporting multiple versions of OS, we have to > leave result alone. It has to be 0,1 or success/fail. We cannot use it for > errno. As Mimi had pointed out, since the value passed in result parameter is not always an error code, "errno" is not an appropriate name. Can we add a new field, say, "op_result" to report the result of the specified operation? thanks, -lakshmi