Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp669722imm; Thu, 31 May 2018 07:25:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJAWjB3qboH5tbjhTtfCWUPeBEIPWCIJLAzpv43DUESXbVRVjLEjqZTw0FtEPSTI4h7RvfV X-Received: by 2002:a63:a74c:: with SMTP id w12-v6mr5794961pgo.374.1527776754486; Thu, 31 May 2018 07:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527776754; cv=none; d=google.com; s=arc-20160816; b=Zm77uXOkiTYJMq3RzIMEjtfHAjWmVLPWGhZAH/3NKL3VH0X+f1JeD7bFEoiO3sEP14 2gwqOT7P+WdSa110ij540l92LJJ1/OEzz2K1Y/QSGI17mJsqQEFScGS0R7CNsIo0QxzL qaP9TYMkbGjNk4+7H86y/aCqbGjjyP4vM6WdWq73yGQ6BSLr4m3tH2ZBvcIj8XwO7+na oYwiT7Ko2iO8G1pf+IdmMP8Fi/+pIupcRIYckVypK0agWAy69Iwirxp4v1ESt5MA0HJ1 QZeSNmLfdvW3rfsM+ePFKQQ2/Mla7el/QjdoYuCyNi2iUAyDKLOzyy7ml/jCwAj4R+XX todQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=Qo8Bss/Zdwqulz0cssf9a923rrMKUz2Bxdnj0gxR6R4=; b=qIobluPQ0QnZBRdill9dfkSuKd57LfWVSMhDjlcFBvcFmuvAkX1v8OwOgDtle7mw7Z eG0ktQEzgoyjUBkITtbYQKry6dmnRj6EWoyxaDNy+1yk6gsCN5T9qF05xUYSgiiJo8CR MwMkmxk6GwU1LZ1YbHmQfff7+GnkcYGK+CMOe/kdAG6ETzG+rzrkiVV63N/93/7VTr52 I88Vr7iZa6/h7rF+WA3HurUuZK7JXa+pGgQqy1CDwyt9hvhOutTbzQ+n4WighyB6WEMc CUV7tCroys01rhdBgcbuWV7uvPzTASaeLCsXthZxGHOTfi6svFMMiHO/wy1mKW6W+P/j 3vsQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10-v6si28928085pgp.419.2018.05.31.07.25.39; Thu, 31 May 2018 07:25:54 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755374AbeEaOZS (ORCPT + 99 others); Thu, 31 May 2018 10:25:18 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45880 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755335AbeEaOZL (ORCPT ); Thu, 31 May 2018 10:25:11 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VEOEaO027666 for ; Thu, 31 May 2018 10:25:11 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2jahmjknqk-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 10:25:10 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 08:25:10 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 08:25:07 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VEP6kB196882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 07:25:06 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B2D47804D; Thu, 31 May 2018 08:25:06 -0600 (MDT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id D6A5A78047; Thu, 31 May 2018 08:25:05 -0600 (MDT) From: Stefan Berger To: zohar@linux.vnet.ibm.com, paul@paul-moore.com, linux-integrity@vger.kernel.org, linux-audit@redhat.com Cc: sgrubb@redhat.com, linux-kernel@vger.kernel.org, Stefan Berger Subject: [PATCH v2 2/4] ima: Use audit_log_format() rather than audit_log_string() Date: Thu, 31 May 2018 10:24:58 -0400 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180531142500.4193818-1-stefanb@linux.vnet.ibm.com> References: <20180531142500.4193818-1-stefanb@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18053114-0012-0000-0000-0000165C4B92 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009102; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040334; UDB=6.00532531; IPR=6.00819463; MB=3.00021393; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 14:25:09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053114-0013-0000-0000-0000530FA4C1 Message-Id: <20180531142500.4193818-3-stefanb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-31_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310163 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Paul Moore --- security/integrity/ima/ima_policy.c | 3 +-- security/integrity/integrity_audit.c | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 1d00db19d167..3fcf0935468c 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -634,8 +634,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