Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2948323imm; Thu, 24 May 2018 19:41:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpz8HH38Ej/x0J/28cow/zgP1Vdz4CB56SqvUYk0EwGfUaAKInWYMvCkPw75NpLvmOUyZdH X-Received: by 2002:a17:902:52c8:: with SMTP id a66-v6mr595399pli.131.1527216088130; Thu, 24 May 2018 19:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216088; cv=none; d=google.com; s=arc-20160816; b=pbSmOEWEsgci5HYIvBIpJ/+24Ov8RqPnhOjMhg9Am/ia5of0TYPL6s7/MdkZRlA3Qx hjOqvseOHchgm86Jf7eZ/buS1WlCjIeEk16dxD6ez08P+xxlE5A1f/7MEUIYvp9Tk09/ CejdGAzVtmHJM4HGTQ/yj+OWTBvv1WVEZkS7cbol80pKBGKjKyalDXqhrBtOzVYWULat qYWleWOB8vREQzXJlQ42e9jO2NpLyxwmLPEOPwZfvIcUmooVZCilxboyPzf2tVA9q6az F3wQQa2RvhXqqftLbjEn3sEy11E6H1XjVDwuDttumbH7cJ9DqntmpI52tfZxo4gMFMoQ 9/JA== 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=Vw2XracRa/3dquor/0k+/HTzSfihOI2mRWRaZGs3j3w=; b=SyswiXb7mU19MaOtlnXJzNol4sqGEDk5zxBKkkKCm6iQ4ZVQg4p4nHvR2O0KARnPyZ 8ypSFI7A4ALOHoD3iahxgsYlUW2Ae240py5Jj4TzGxOaouoMB1XVHe3CPdFc68iPm9q3 cK6onO1mUFFHOTn1Pyx2mlWUhKzVClGmZXBIhJLdX84oeD9uy4XJB8KV2cwBGnBoc4Cg 3JxagNnK5Zm0gNP+3jLaP/crrGAb6eF0/3ohl5rRd2C91k/GqLqGNTX6fL3/1jbqKfFb rGC5DdFm/bORYsReTgpiQjw4tgPWZebekHLtdbE9KWW8HjUGWwg0Dowq1WJkS3GGk1Nf HERQ== 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 t196-v6si11644887pgc.648.2018.05.24.19.41.13; Thu, 24 May 2018 19:41:28 -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 S971324AbeEXUL1 (ORCPT + 99 others); Thu, 24 May 2018 16:11:27 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60110 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968753AbeEXULP (ORCPT ); Thu, 24 May 2018 16:11:15 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4OK4Dpv036005 for ; Thu, 24 May 2018 16:11:15 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j61cnff1v-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 May 2018 16:11:14 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 24 May 2018 16:11:12 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 24 May 2018 16:11:09 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4OKB88U6881606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 May 2018 20:11:08 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7512AC0E5; Thu, 24 May 2018 16:12:37 -0400 (EDT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 9A678AC0E7; Thu, 24 May 2018 16:12:37 -0400 (EDT) From: Stefan Berger To: zohar@linux.vnet.ibm.com, sgrubb@redhat.com Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-audit@redhat.com, Stefan Berger Subject: [PATCH 2/8] ima: Use audit_log_format() rather than audit_log_string() Date: Thu, 24 May 2018 16:10:59 -0400 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180524201105.3179904-1-stefanb@linux.vnet.ibm.com> References: <20180524201105.3179904-1-stefanb@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18052420-0044-0000-0000-0000041A8049 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009065; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000261; SDB=6.01036001; UDB=6.00529949; IPR=6.00815130; MB=3.00021234; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-24 20:11:10 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052420-0045-0000-0000-0000084C9D6C Message-Id: <20180524201105.3179904-3-stefanb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-24_07:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805240228 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 --- 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 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