Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp842609ybt; Wed, 17 Jun 2020 15:41:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlXVX2i24irfm1nVaO7zEp/Yarj7uHRH6PeCOU/7Gn2SNB/Sz1Wl2wFvKaklhPucFDYMIR X-Received: by 2002:a17:906:aad8:: with SMTP id kt24mr1219403ejb.527.1592433682243; Wed, 17 Jun 2020 15:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592433682; cv=none; d=google.com; s=arc-20160816; b=mkFqT9NhEYwwGfi9W2fjPeUfKORg8uibji2lAO6kduB3pA8IaISrDL6tqK1WendscP CuYT1/3dF4x939ujVMKvuIv1lETZaWXuaTBRBYXt+JgKJLm+gWYpBEADqADGKLTLw2UM Z1Ke8FeTpVAOFPBUkYEJd32crizjb9HGiB6VLNmbrBIl0YTIv0mJVq7cg7cA4hQc/QnJ UEJu0QvDsIPF4CZG/8b7JLAnD1kpT8ThAnNSq9JuHTx3F4YSY9pQTu5eAkXusCSIHr3N EE3odnUBEqQzXac21HyVBEH+p+U7RQ/0ZKOhHJRsP0lCYldZ6ez5wrKgdBHMA+QJUQ5n mcKQ== 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=PqSlpxZ3YN58ZRJ/BXA2pFGBO/xB6CvZLuRPE0ix/fQ=; b=Q/cabJz38TzTRGx462QQewRwxARWD+47QqdymowmOj9rlcTImm/JNckO1N4XGA53hs sr2hb7W2Ro+LhykH8ZHh9vFfPz79nBZQoJsFtyumoUQkatdKG2wSMfowZPn2CmYwUI1Q Pyi/ybqiqTj1kIOanqkn/I3HidyEyWM6/1udvQL0BeOFTI5c6iM8qnVrTcC2Htj4Rm1z 1frAk53vdg1UcJWgFOkfuww4EI6h8pnqZwc00JbGjd38HSqqdelp9rAHVMlHVl3K+m9F IQrEky5o+oCVO/KZxyrIipd8vBqVJWyQm4fcy5tImh+yGBsdq6UGQamo1tW/Cq7cvw8R qX5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="VK86r/2s"; 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 g14si717052ejo.587.2020.06.17.15.41.00; Wed, 17 Jun 2020 15:41:22 -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="VK86r/2s"; 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 S1727038AbgFQWg4 (ORCPT + 99 others); Wed, 17 Jun 2020 18:36:56 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:50199 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726758AbgFQWgz (ORCPT ); Wed, 17 Jun 2020 18:36:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592433414; 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=PqSlpxZ3YN58ZRJ/BXA2pFGBO/xB6CvZLuRPE0ix/fQ=; b=VK86r/2sMvOxyXXnWT7Nd7cBr5q1FYTPMQ8/ojjkj5qF1enO0Z7NOzp9QycqXO6kgVLI0a A3NYc6k+yPs9DgYYXO0B53pjmETs2YkEM4Gm0qKzK40Uq2zoryixvWsZGmLzNTbnUS7qwg +dkPJZRw7eA6mB8SGGaGbBHyMuBIjrE= 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-405-XNWeQA5YO767oZg56rfV3A-1; Wed, 17 Jun 2020 18:36:51 -0400 X-MC-Unique: XNWeQA5YO767oZg56rfV3A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21CC91800D42; Wed, 17 Jun 2020 22:36:50 +0000 (UTC) Received: from x2.localnet (ovpn-114-52.phx2.redhat.com [10.3.114.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id D25BD19931; Wed, 17 Jun 2020 22:36:43 +0000 (UTC) From: Steve Grubb To: Lakshmi Ramasubramanian Cc: zohar@linux.ibm.com, bauerman@linux.ibm.com, nayna@linux.ibm.com, paul@paul-moore.com, rgb@redhat.com, linux-integrity@vger.kernel.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] integrity: Add errno field in audit message Date: Wed, 17 Jun 2020 18:36:43 -0400 Message-ID: <3369897.H5lpGJDj0b@x2> Organization: Red Hat In-Reply-To: <20200617204436.2226-2-nramas@linux.microsoft.com> References: <20200617204436.2226-1-nramas@linux.microsoft.com> <20200617204436.2226-2-nramas@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.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, June 17, 2020 4:44:36 PM EDT Lakshmi Ramasubramanian wrote: > Error code is not included in the audit messages logged by > the integrity subsystem. Add "errno" field in the audit messages > logged by the integrity subsystem and set the value to the error code > passed to integrity_audit_msg() in the "result" parameter. > > Sample audit messages: > > [ 6.284329] audit: type=1804 audit(1591756723.627:2): pid=1 uid=0 > auid=4294967295 ses=4294967295 subj=kernel op=add_boot_aggregate > cause=alloc_entry comm="swapper/0" name="boot_aggregate" res=0 errno=-12 > > [ 8.085456] audit: type=1802 audit(1592005947.297:9): pid=1 uid=0 > auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 > op=policy_update cause=completed comm="systemd" res=1 errno=0 > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Steve Grubb Acked-by: Steve Grubb > --- > security/integrity/integrity_audit.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/security/integrity/integrity_audit.c > b/security/integrity/integrity_audit.c index 5109173839cc..a265024f82f3 > 100644 > --- a/security/integrity/integrity_audit.c > +++ b/security/integrity/integrity_audit.c > @@ -53,6 +53,6 @@ void integrity_audit_msg(int audit_msgno, struct inode > *inode, audit_log_untrustedstring(ab, inode->i_sb->s_id); > audit_log_format(ab, " ino=%lu", inode->i_ino); > } > - audit_log_format(ab, " res=%d", !result); > + audit_log_format(ab, " res=%d errno=%d", !result, result); > audit_log_end(ab); > }