Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2002014ybt; Mon, 15 Jun 2020 15:29:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxI7qk/H+ZROxFztQAf+7Eo6FN9tKtjzMd5y8VxpC/ujUMJCDjsf/E0v3wZ0f/g3VNBGEeI X-Received: by 2002:aa7:c15a:: with SMTP id r26mr24773678edp.21.1592260158569; Mon, 15 Jun 2020 15:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592260158; cv=none; d=google.com; s=arc-20160816; b=NTOQ9Q6jFHrpWoBvjqNMUmamejnL/2v1a/NBftRMGnztsMX2kS+toi2TRt+JqXoi3F WfPv1ydnfRtp67be486psNOUHOVk+qX4iXyd+kl5M6/GRAxSf4d0XICUQa8hrOh/vfn0 9cZsTBRkSiZ5cf0zRVaFPn7GyvdwyKjAzF1HdK9ElHa5EfofW9E9kNQAZ8pKVQxHA0P3 k+E6MXdGdqh+A7o8xaSlW2tx12sj6xPBwlRgNcLkMosOZsyAw5cgZSachZoM63KrmHwh 9uNq0f4uwdm7MPb3JPJkvKSRUzIi8Y17L0vrWZLdAyHgggFk/SkLq6neReWpFxq4I9NJ DH3A== 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:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=7ZUPfRcXkYcNh8btCoccdJZ4/n8L7JuZDFt9dxhVoRY=; b=zMucXjRNgVqa1eZ/9mjrMrepXHVv/F0vxwy+JmppSt6KbIR6A9Ap4a8rdqJaM+hOqg 3ayw6jw7Bsc4G9I8vLpzIPqZxhMe56kzGyEy7A/FFZzFLLhLBChWFLwDkC8vMpo2PaJB TMVwAW0W5qjUd4eEnRWNm+JpFlVzayyiwwb+ojVjQunz6VUM6IW7Lbo6JLrSexr7DaiT 7BV90f6FjzIHOOyvoSjavhO4K936c6l+Z9jxIMpFk98pPOWMpa6zwPzTHmmloV1PPVva Hib7HL3/KXNGPuEEKdsBYazC26a19mvUldnyb6mhRAsUuVC9wKCvwnNelhpXYssxKurz UseQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NKLcD6Nq; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w27si9538176edi.519.2020.06.15.15.28.55; Mon, 15 Jun 2020 15:29:18 -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=@redhat.com header.s=mimecast20190719 header.b=NKLcD6Nq; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbgFOWXu (ORCPT + 99 others); Mon, 15 Jun 2020 18:23:50 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:52487 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726662AbgFOWXp (ORCPT ); Mon, 15 Jun 2020 18:23:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592259824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7ZUPfRcXkYcNh8btCoccdJZ4/n8L7JuZDFt9dxhVoRY=; b=NKLcD6NqxqXIPKJWbeZJAbqN0RZmTki3ORGohhX8jkSNiDiWDhTj2SDEuahcWZApBg8fyR 7Z+sKfrhwYJ9/3082pHc5Zc8BJzC+IL+LOqApS2EmtWbs/tOV97nyXGMeVdLpGpSoLbY+c 66gxW9LJJV50NyY3uRbt2Wt4De0czlA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-ackfh9KUMRKa6acvAk4UyQ-1; Mon, 15 Jun 2020 18:23:39 -0400 X-MC-Unique: ackfh9KUMRKa6acvAk4UyQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E9FE803313; Mon, 15 Jun 2020 22:23:38 +0000 (UTC) Received: from x2.localnet (ovpn-114-75.phx2.redhat.com [10.3.114.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E48F10002BC; Mon, 15 Jun 2020 22:23:31 +0000 (UTC) From: Steve Grubb To: Lakshmi Ramasubramanian Cc: Mimi Zohar , paul@paul-moore.com, rgb@redhat.com, linux-integrity@vger.kernel.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] integrity: Add errno field in audit message Date: Mon, 15 Jun 2020 18:23:31 -0400 Message-ID: <8800031.dr63W5FlUW@x2> Organization: Red Hat In-Reply-To: <42482562-d74c-2678-069f-1d8ef4feffac@linux.microsoft.com> References: <20200611000400.3771-1-nramas@linux.microsoft.com> <1591989920.11061.90.camel@linux.ibm.com> <42482562-d74c-2678-069f-1d8ef4feffac@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, June 12, 2020 3:50:14 PM EDT Lakshmi Ramasubramanian wrote: > On 6/12/20 12:25 PM, Mimi Zohar 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. > From the audit field dictionary (link given below) "result" is already > a known field that is used to indicate the result of the audited operation. > > @Steve\Paul: > Like "res" is "result" also expected to have only values "0" or "1", or > can it be any result code? It should only be 0 or 1. Sometime in the past it may have been the words success/fail. But we've been converting those as we find them. -Steve > https://github.com/linux-audit/audit-documentation/blob/master/specs/fields > /field-dictionary.csv > > res alphanumeric result of the audited operation(success/fail) > > result alphanumeric result of the audited operation(success/fail)