Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3778260imm; Tue, 29 May 2018 13:32:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrCxpG6AsaOAsObIKJBcOD11nZokhtCTKF1wOeIXxPf8sbtb0s5mOtJdopE2Xz+xwZgLYMM X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr19651597plg.38.1527625946237; Tue, 29 May 2018 13:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527625946; cv=none; d=google.com; s=arc-20160816; b=IhBtgLmaNc9KQIxVw2O8OiZuJUbcnErBUjDRqPtlRvsMDsU3MyzuOto60eI1nnaKl9 lol5ZeQq92GZftm/8d10W8ETjWpFg10I4fYm+f1ykxfdt65HXn+Rov39SlITjbAoye35 L+tNT/dF+LgYqVhm4MXQHpHU3l4vEtsjdEeyXi2rHjqESg4wChAIA0WInc+TMiwwZm16 zDzc4Yl0KPjPtBZlU0F2iSGfBzj/IEUMy+yIw+C6LmQU6y8UFVY01BWzRgszz49gsrWQ NyuliIytNt3JWXYa3pmqe4yFpzG+d2qiKVJYrgFH6uzUqoDn5djFmrea3/Vfk6SOWU9i To6g== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=SMqiOnpX41rh3H6eYzmmg/7gspbm8m9bOKieLZE9YXY=; b=hm5NP06EMY7flvpYnxNOeuHsbw15CaBMnqCFzvZD4Br3yzgIX93TrRgpoeVS7iql0S Ea7F0uH6ti5Y1tZe1ymQ5l6Ofa765X9ChbX8a51ozndNRR4/BEvqQojB97OIyNcKrk33 Acc0hhelpg4EquyiXYYdjS9U4WQOOldxhaWaPa7QlFFzXp35xwOhIHMhwESFEp1an8RX 9fPObSoT5UP0tbl40LcDRX3oVqXSn7LE75+QuYz6zF0iTyBf3sEukDZc7mLXx73a/Y1N mgx/FLsyobPwv/GKfg+nUR+U/Z9sjhKoQiqGjkRfup2P75F/eI5TmSgags7pKBckApjO efZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=A8H1yoC1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14-v6si9467773pgu.415.2018.05.29.13.32.11; Tue, 29 May 2018 13:32:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=A8H1yoC1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966767AbeE2UbO (ORCPT + 99 others); Tue, 29 May 2018 16:31:14 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:40204 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966721AbeE2UbL (ORCPT ); Tue, 29 May 2018 16:31:11 -0400 Received: by mail-lf0-f67.google.com with SMTP id q11-v6so774249lfc.7 for ; Tue, 29 May 2018 13:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SMqiOnpX41rh3H6eYzmmg/7gspbm8m9bOKieLZE9YXY=; b=A8H1yoC17RU+y4poMMX3UvUtARc77Lh8WtwUeRRTLzkwQKwEhw/p25HiR7+fUH9bJ+ vjswRva4qpVCnDwMToIR0xcVZmbtfZjbnKdhQvG+s78iw0yLCn64T4oFLqZhFkiajRkp Kb4lXss/zEIAK3C0Bqv/aValK0WgWOZc7Ar9o7GOZG8eQ3AKJ3Xq/bZkjzYpA3m8BgIu +4kkXKGF3F7Q1TJPNwt3ZFFGqlTn3h6lhgoqQAGTvh8zncvFc7kQbm1MxlvoJWAF8Ug1 V2iGhky88HYDDQBBNQ6DoTBRALDcPtk6uhwTolkmAFPSNN7K8zXO+ZFqblHXI/cQC7Td uUhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SMqiOnpX41rh3H6eYzmmg/7gspbm8m9bOKieLZE9YXY=; b=k0JeklIQ3BY0o5iN9Ugri4xl7nAViFfxcSfeOaKr37OtP0DuiEUCwzsBbAS6csyNK2 Eavx92xvv3J7UcDBQAc5sIGySKWUo+VzlNZzG33leGSoKUpvXxUU6xhPu6bBePiWFPhf N/NESPWfPx9mZClJ22JE9nJaR+gSnywb2501Mi72tZoHvZVM4Z3N77kVbdyJzgMX8z6s ciYOFbBtoIfA9cwmA4Hn9/yrR5Sha8OZh+0jCh707nxx6JxcCcBDeTEUhgrt8vz3ysqX tFzPaUFYu65hA6AGC2mgNDxv/GEjyJPH8RwXjq0t+HIPnduq/wEaK8hbgsHtgswsOQUd 86Yw== X-Gm-Message-State: ALKqPwe0w2iD1H34cbO1kjE6QiZp5aeYGlqWLH/pjZIaqgOJJqtQz/vr qG4BH7Yk+rSilupkNrMbHvJ4ZlDHi6b4tnlBiQY/ X-Received: by 2002:a2e:18b:: with SMTP id f11-v6mr3973562lji.83.1527625869962; Tue, 29 May 2018 13:31:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:a911:0:0:0:0:0 with HTTP; Tue, 29 May 2018 13:31:09 -0700 (PDT) X-Originating-IP: [108.20.156.165] In-Reply-To: <20180524201105.3179904-3-stefanb@linux.vnet.ibm.com> References: <20180524201105.3179904-1-stefanb@linux.vnet.ibm.com> <20180524201105.3179904-3-stefanb@linux.vnet.ibm.com> From: Paul Moore Date: Tue, 29 May 2018 16:31:09 -0400 Message-ID: Subject: Re: [PATCH 2/8] ima: Use audit_log_format() rather than audit_log_string() To: Stefan Berger Cc: zohar@linux.vnet.ibm.com, sgrubb@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 Thu, May 24, 2018 at 4:10 PM, Stefan Berger wrote: > Remove the usage of audit_log_string() and replace it with > audit_log_format(). > > Signed-off-by: Stefan Berger > Suggested-by: Steve Grubb > Reviewed-by: Mimi Zohar > --- > security/integrity/ima/ima_policy.c | 3 +-- > security/integrity/integrity_audit.c | 6 +----- > 2 files changed, 2 insertions(+), 7 deletions(-) Acked-by: Paul Moore > diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c > index a823f11a3e6b..7297450b813c 100644 > --- a/security/integrity/ima/ima_policy.c > +++ b/security/integrity/ima/ima_policy.c > @@ -615,8 +615,7 @@ static void ima_log_string_op(struct audit_buffer *ab, char *key, char *value, > audit_log_format(ab, "%s<", key); > else > audit_log_format(ab, "%s=", key); > - audit_log_string(ab, value); > - audit_log_format(ab, " "); > + audit_log_format(ab, "%s ", value); > } > static void ima_log_string(struct audit_buffer *ab, char *key, char *value) > { > diff --git a/security/integrity/integrity_audit.c b/security/integrity/integrity_audit.c > index 90987d15b6fe..db30763d5525 100644 > --- a/security/integrity/integrity_audit.c > +++ b/security/integrity/integrity_audit.c > @@ -45,11 +45,7 @@ void integrity_audit_msg(int audit_msgno, struct inode *inode, > from_kuid(&init_user_ns, audit_get_loginuid(current)), > audit_get_sessionid(current)); > audit_log_task_context(ab); > - audit_log_format(ab, " op="); > - audit_log_string(ab, op); > - audit_log_format(ab, " cause="); > - audit_log_string(ab, cause); > - audit_log_format(ab, " comm="); > + audit_log_format(ab, " op=%s cause=%s comm=", op, cause); > audit_log_untrustedstring(ab, get_task_comm(name, current)); > if (fname) { > audit_log_format(ab, " name="); > -- > 2.13.6 > > -- > Linux-audit mailing list > Linux-audit@redhat.com > https://www.redhat.com/mailman/listinfo/linux-audit -- paul moore www.paul-moore.com