From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BB02C433E1 for ; Mon, 15 Jun 2020 22:51:50 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF25520739 for ; Mon, 15 Jun 2020 22:51:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OJQ5Cjmk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF25520739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paul-moore.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-audit-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592261508; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=E/9XiIflgF2J5bHnJU0GeklQHNT+NStjGWA0ScNDnHc=; b=OJQ5CjmkQqVlP1eN4oXwjKol91z1h3wWfIeqZiMmMjAZBk+3KV28OQaapCyU5M7g0iRPJS Lq6j6icq19T9EeScBoYfNutd5buyhna+/a0fgaPhx5lSoimrgA12vAP0GVGzUBt8zpke3a JA+wApdpvNszoQSzJl5vvMhGGtn7Nfk= 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-163-PNFMU6avMBe8zSw-vXqdKg-1; Mon, 15 Jun 2020 18:51:46 -0400 X-MC-Unique: PNFMU6avMBe8zSw-vXqdKg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68A1B101C2C7; Mon, 15 Jun 2020 22:51:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B5A05D9CD; Mon, 15 Jun 2020 22:51:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 201A11809547; Mon, 15 Jun 2020 22:51:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05FMpekm009735 for ; Mon, 15 Jun 2020 18:51:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3F07D2026E04; Mon, 15 Jun 2020 22:51:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3AAF9202683E for ; Mon, 15 Jun 2020 22:51:37 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73C778316EB for ; Mon, 15 Jun 2020 22:51:37 +0000 (UTC) Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-JtHODIPuNOul7wYyKM5TxA-1; Mon, 15 Jun 2020 18:51:34 -0400 X-MC-Unique: JtHODIPuNOul7wYyKM5TxA-1 Received: by mail-ej1-f66.google.com with SMTP id q19so19282179eja.7 for ; Mon, 15 Jun 2020 15:51:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SGExwC1aIDo5/1NE6vpBPs1NX4b+lnmovMgwaKLnO7A=; b=mY40q9cPtUmFYfhUl7xDlQDuJXya8AKwo54cfThXxTXWajiHOpcvs8ESNLRBHR/Hg/ fjDkwUeGR/dGZ5D5OXiu3TI99Rir/vbNK1j2hHbsN3KzuBrObl4L3KaEootuLJqN114d Rc+mJTy3acq+QMsye2Z0B3iL5dGGBV+dmUVr32CVJoIMXdmRROM1OPAiFPXGx6FDkMbH ZcYhnIRCM4Hq4Ka27jo5Q7u86BjN2g+4jH76xulEgMKiepYYv5kL+4x3YcZoO2FNUEZm eeVTac5nAwtM0oVaOVARwbTHvLnQiB11yCwcnHI95JClzZ0mK44LYDcoNtigIne6p2IY TvKA== X-Gm-Message-State: AOAM5316wyNBu9EoZeXyRO+GbZAqXVWS8ShRwzUc+NGuiBTZSPY1A7Rn kxfT0OvJSViD0oNp6639o2Z9P1PQ154wG73I4E4W X-Google-Smtp-Source: ABdhPJwx1DRTehCMO5F4dqY47teRIjLqnY3HxSm5d2M5fUhGXkw5h1uYR4YVOM7dFC5GGztogb3hEIyikdfe0ETfuBk= X-Received: by 2002:a17:906:2b81:: with SMTP id m1mr67681ejg.488.1592261493251; Mon, 15 Jun 2020 15:51:33 -0700 (PDT) MIME-Version: 1.0 References: <20200613022633.3129-1-nramas@linux.microsoft.com> In-Reply-To: <20200613022633.3129-1-nramas@linux.microsoft.com> From: Paul Moore Date: Mon, 15 Jun 2020 18:51:22 -0400 Message-ID: Subject: Re: [PATCH v2 1/2] integrity: Add result field in audit message To: Lakshmi Ramasubramanian X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: linux-audit@redhat.com Cc: rgb@redhat.com, linux-kernel@vger.kernel.org, zohar@linux.ibm.com, linux-audit@redhat.com, linux-integrity@vger.kernel.org X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Jun 12, 2020 at 10:26 PM Lakshmi Ramasubramanian wrote: > Result code is not included in the audit messages logged by > the integrity subsystem. Add "result" field in the audit messages > logged by the integrity subsystem and set the value to the result code > passed to integrity_audit_msg() in the "result" parameter. > > Sample audit message: > > [ 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 result=-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 result=0 > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Steve Grubb > --- > security/integrity/integrity_audit.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) If we can't use "res=" to carry more than 0/1 then this seems reasonable. Acked-by: Paul Moore > diff --git a/security/integrity/integrity_audit.c b/security/integrity/integrity_audit.c > index 5109173839cc..84002d3d5a95 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 result=%d", !result, result); > audit_log_end(ab); > } > -- > 2.27.0 -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit