Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2569837ybt; Tue, 16 Jun 2020 09:15:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMHH5lsXvQ0dTBBTZozPnKkyiCw8gr0DdOXrzIqHHHkyehH/jEUE9Gob2E/icBbzWGMyht X-Received: by 2002:a50:c219:: with SMTP id n25mr3325361edf.306.1592324102584; Tue, 16 Jun 2020 09:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592324102; cv=none; d=google.com; s=arc-20160816; b=u5AcZgeh6ITzy+G1C+F0uALHE20RMCRoUaMdFCmOvdyhaA0+j9FGV4hpTZVjiWjFNr 7uSmBUFIqHn9NVpums97inX8asEm3qwJgi7ALYfJ0F+v7fmwtyLDszglDn+lsA9qKEOU Ybz6N2Fu3k9W1cD/rvBukSn3Om3K4czpQFEdFqhpZGkMzY1RBvVIk03j3vtnKw2rR0Tw 9il1yW0iC7RhTyWI0FxBUpR7pJ7eOHy83C/DyQa5t+eAv4UIJ2k8mSB7JdktoyrvIyfA Xlow8wfp9Kcrylg+xutBaxl47h7O2wFLNFLnQAUIMxu8W0HvShvP0Lx37AMf3ulHRJQ4 5bFA== 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=oKDGWEKwqPpKFVbswFpUDNbyYl/9csGc/AghQtdbXr0=; b=sQwugvExssjLVAYpPabFPGFc1iV3TrIukrOyx1dRBOpJAQ7v/1FHSn0PN+m/tPMlDJ T9t6i0Z8OlaszhFpejhYdTA9Mr2kpLhXa469IpIkK1mNyFLQYd0lLS9R3YEGqe9e0DkQ PDVdgjXzLVz0zP7h4uxSmsD0MChQVtZeXuGgTrqVe+eUEG9AohTn/n+E1YtFQUzZHBvE CGc2PvtCEHLQ9/hzT71CYrR2OSMdL9XFQhxWUUJ1OzzAIHJ0X8bcdBvPIQ1JgTjqYEhK G4t4Ad86bSd/lQvujp0rFH4IDva09GvMWnJlWwthnZyy1P6exwCRkFM8e/sANRWHbC+y xMtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KDGj9ezX; 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 x22si11213960eje.542.2020.06.16.09.14.39; Tue, 16 Jun 2020 09:15:02 -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=KDGj9ezX; 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 S1731850AbgFPPnq (ORCPT + 99 others); Tue, 16 Jun 2020 11:43:46 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:24891 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731827AbgFPPnj (ORCPT ); Tue, 16 Jun 2020 11:43:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592322217; 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=oKDGWEKwqPpKFVbswFpUDNbyYl/9csGc/AghQtdbXr0=; b=KDGj9ezXb0MATsoFrINZS/KJ9YGE0IRYNuxPqefFDG0loeuHQ0mTUMQlbj21UcRLjKxhjv 62b+wbnLFk7COuSJPWNGsYeS4LBp4htdQ+LpYWoytZZ6sWljzIOU3wojamHfPwIFqTzTpF IG4JgtXAbYLlhGpoOWCYbJmI0PF913I= 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-205-18RYIHL_PyO2hLSMA5unqA-1; Tue, 16 Jun 2020 11:43:36 -0400 X-MC-Unique: 18RYIHL_PyO2hLSMA5unqA-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 C5B1910AEA20; Tue, 16 Jun 2020 15:43:34 +0000 (UTC) Received: from x2.localnet (ovpn-113-82.phx2.redhat.com [10.3.113.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 777BE1001B07; Tue, 16 Jun 2020 15:43:28 +0000 (UTC) From: Steve Grubb To: Paul Moore Cc: Lakshmi Ramasubramanian , zohar@linux.ibm.com, rgb@redhat.com, linux-integrity@vger.kernel.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] integrity: Add result field in audit message Date: Tue, 16 Jun 2020 11:43:26 -0400 Message-ID: <41911815.FMGa2a4QOz@x2> Organization: Red Hat In-Reply-To: References: <20200613022633.3129-1-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.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, June 15, 2020 6:51:22 PM EDT Paul Moore wrote: > 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. Paul, But we can't do this. The field name dictionary says this is used to convey success/fail. It is hard coded in the field interpretation table to look for 0/1 and interpret that. Interpeting this field will now produce an error message. And "result" is a searchable field. As I suggested a few emails back, let's just use errno or something not already taken in the dictionary. NACK. -Steve > 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