Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp793979ybt; Wed, 17 Jun 2020 14:18:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrDrJJ2vbhmDSK/clVJRqybZ19DSNuf2DgHy6uAb4aE64Ac3nv6QkNi21SUroNOjaGFxuN X-Received: by 2002:a17:906:97cb:: with SMTP id ef11mr1044614ejb.69.1592428683895; Wed, 17 Jun 2020 14:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428683; cv=none; d=google.com; s=arc-20160816; b=byYKKv7jpdGXmXF0wE8ZcCjyO7cn5zn9wS6hRVsu4Rj3nz1VtqiqpyApf8BmpdY3/L pXGqyZybhZmIc4d/YMqRAmrrRxIIlpHl/yIfwEvKjhjXy4DZpcvOSv0OOgVgpiihdeGi vQ7GwKFBRv+RNkcDY8Fk4LglvNMeagO1iU1aMLFuYYY2ij1wP/bhn5g+v/O3M7vHvHEs Aw2ycUlx5QXrhb3nG6xXCXegE4kO+8PT+PL6K6cwzjjQKpoM/MgK0DjbnDcxQ+eolVMC gyU68rrnXKe72q7wH+RStd4+P2kfIV0yeZFVudBbB0mZnAbdCthMULtbZPORUgI2Uw3z MHKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=aF2QFHszBUveBEYuZ4El0wMTZ2oyuOvfLY0YCwJErgY=; b=HLMWG2GMhdUi2O0R1l4BxKZunBKHNfAIkVGM1eJFxlyxQ8tgp1+ZVO3dKC9dmFvuTU 7XCodT6Sbk7fhkPx7kdHX/P2+3Ly4YrfjYgF317LWJdpoR5Md0cO4g/x/gvVohODDKGN ohNl6FeWhq/ogewvc6YCqKtvYAjVx0v9ApOkLfeYsk8BjMNgQtVo1IntQuvs4O3ZudVp wo7Bkngsw2Zu8mkbVSJdOIq/+zT27+vf+WqNJ2koY+eF1jqlzE/zkq8CmyWtDk9ScwNI iAza+aOzuDs4c4e/iKvoqYgJi/R6+qvQaA50/MBlkseQdpNsN672fLBo2f8iRfXv1Y5s +GvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=WlXbj9ju; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si659695ejy.5.2020.06.17.14.17.41; Wed, 17 Jun 2020 14:18: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=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=WlXbj9ju; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726995AbgFQVP3 (ORCPT + 99 others); Wed, 17 Jun 2020 17:15:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbgFQVP2 (ORCPT ); Wed, 17 Jun 2020 17:15:28 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8C5C061755 for ; Wed, 17 Jun 2020 14:15:26 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id p20so4081517ejd.13 for ; Wed, 17 Jun 2020 14:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aF2QFHszBUveBEYuZ4El0wMTZ2oyuOvfLY0YCwJErgY=; b=WlXbj9ju55dGjHRzLb5C+A8WJ5rU77z376DVpc11si+Mfk0mgl/SUv0GjXDMTXTPU8 fkUT4YuEl24pt0ed8H2rwHxZmwl+0En+63ihMhy6iz1uo1YOJOvbn2kgp6I+oeDe0cL+ vrKCnZo8IFvhrHmrIOp3beUH7vYfUsZg+zPRk/xHGsG5Ltlg73jB9l3leAp6Gazgra1G Q1l8GejBcNKrpCet0IlhxN5hE1ntYGvElCeF9qBiPymC/Yyp7XGcu+jhviej5TLXWwTK bCtFSc518u83smtBb6UwaDe8klytUX6DaGAmo/MTPVi3nU+F3w9WqyVROlmEw7jPu7/b VCgg== 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=aF2QFHszBUveBEYuZ4El0wMTZ2oyuOvfLY0YCwJErgY=; b=GqnMs/tOM8pltuaL4BkZNRW2Nfl4HoMScMZ1dIOGdFPIM2uZwXGL59pblLEvPfak9L pO8nf//PzR3SUe+TnNHnE0AoP8ULNi/jDlfkPj3pFqvR12GtutuxlIzVUFEZVru0AMYF kd1tiS7+TJjAKekI5kT1sadCZJxHLYSbppDrgOgjKGAt2VrkzzoMNQjw4pKa8ISlCRQr 5naoj439/awMzEyw6WNq2uVp4IU6aYW2iVyKBHUjpc9z9Z3P46vPdfDFIvLIpC4IZvaZ pNi0t6YAHjgwYGTP1FrPzL6EBt/0t1lC9AuNVBfopzJS9K5LyYGYJdWwnm5frQid2t3U 3Nzw== X-Gm-Message-State: AOAM533aFoLV2CiQ4p21iQIJKwI0b+KEVkjwg5+6UVSkaEfRD6AB59oN 5JVsFPqdmLiKbr76Zl0iA4LOPwiKb5k2ZJqBbac4 X-Received: by 2002:a17:906:ecef:: with SMTP id qt15mr1003538ejb.91.1592428525325; Wed, 17 Jun 2020 14:15:25 -0700 (PDT) MIME-Version: 1.0 References: <20200617204436.2226-1-nramas@linux.microsoft.com> <20200617204436.2226-2-nramas@linux.microsoft.com> In-Reply-To: <20200617204436.2226-2-nramas@linux.microsoft.com> From: Paul Moore Date: Wed, 17 Jun 2020 17:15:14 -0400 Message-ID: Subject: Re: [PATCH 2/2] integrity: Add errno field in audit message To: Lakshmi Ramasubramanian Cc: zohar@linux.ibm.com, bauerman@linux.ibm.com, nayna@linux.ibm.com, sgrubb@redhat.com, rgb@redhat.com, linux-integrity@vger.kernel.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 17, 2020 at 4:44 PM 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 > --- > security/integrity/integrity_audit.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Paul Moore > 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); > } > -- > 2.27.0 -- paul moore www.paul-moore.com