Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp106394imm; Mon, 4 Jun 2018 13:57:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKcvHBQYm+Z6CcwWDgFmNN8xsdsJD4XqR47u93xQE4vPf0n1ZDn8C36x6hrVbBDcyHlsraD X-Received: by 2002:a65:6303:: with SMTP id g3-v6mr1461392pgv.424.1528145840670; Mon, 04 Jun 2018 13:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528145840; cv=none; d=google.com; s=arc-20160816; b=BvJ2pyuSbKjnnFA2ystETOE/AyNkyrkNTHU7gwKkKWkcqwaZw4eDNvZvkdsexTOZFG PhWu1li6HSGYXkHjjjOnMLWb+bFwgKI2Gkm2cFDnFn22B4T5rYMhCx2sdf1lmHOFdfIB DIjybPwD8l0vKfvy/UkiyLc2pBvnPfj8sJ+YDCYvVy504ZfLZKzr1xN5YaMf4SmyVAvd K8te59CzaGpqCoWCDKHJC55UmfZ0RF8kPpm6ZSUx5PrmPftGon2Iq6u8bbwNljleP+NL T2fJO5i7P8Iz+CV30WodpygQenvTTF0q4Swp8CF5odpUXkuF43RDuX1c2V3Bf5iZ0lZA zIiQ== 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=F1srsdqGisapYlWUCCV+9NwwX+0gGmuJhgXBSss20CN0ZHFwjYC0dbfM4HPBzg4Akw C9jlfGQQoIhX+X2ZBIeTsbR6LwsaksNWN12ztuQONQkbxaWzBo/8vMob2TROKRvOnvo/ VfIGqfcnDvt17BdDp0MOCn4Iidb1CBGiQl0zl1/D63zXjDfwWBBQoZyqwZ6QRz5/aq4t 90Rn6tmBqvy3VK/9NmkRGLEMb89DToXiiMFUgv9uY7rmKbFznPrudJlenPjSg5+8e6UA +XKj2uOx1hRAJ2BG9PZF+1Pak0sb9PpyVibY6tNrtP2NoPXYZmyx4+BT4PQKZRQ4rtt2 qgwA== 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 u9-v6si7183770pls.462.2018.06.04.13.56.35; Mon, 04 Jun 2018 13:57:20 -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 S1751459AbeFDUzM (ORCPT + 99 others); Mon, 4 Jun 2018 16:55:12 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55002 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751406AbeFDUzI (ORCPT ); Mon, 4 Jun 2018 16:55:08 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w54KigoW136325 for ; Mon, 4 Jun 2018 16:55:08 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jd9c7gph0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 Jun 2018 16:55:07 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 Jun 2018 14:55:07 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 4 Jun 2018 14:55:02 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w54Kt20U8782304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Jun 2018 13:55:02 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E89166E053; Mon, 4 Jun 2018 14:55:01 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 348E26E050; Mon, 4 Jun 2018 14:55:01 -0600 (MDT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 4 Jun 2018 14:55:01 -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 v3 2/4] ima: Use audit_log_format() rather than audit_log_string() Date: Mon, 4 Jun 2018 16:54:53 -0400 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180604205455.2325754-1-stefanb@linux.vnet.ibm.com> References: <20180604205455.2325754-1-stefanb@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18060420-0004-0000-0000-0000143E8C8F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009130; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01042340; UDB=6.00533730; IPR=6.00821470; MB=3.00021461; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-04 20:55:05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18060420-0005-0000-0000-000087901BF4 Message-Id: <20180604205455.2325754-3-stefanb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-04_14:,, 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-1806040238 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