Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2948306imm; Thu, 24 May 2018 19:41:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpVziO/Gei3/YgPoyghbCwAt9tDZe21B1qhNeMwS7hlZi14YJ7fctiTAfqa6RD7hZxC1aeH X-Received: by 2002:a17:902:7598:: with SMTP id j24-v6mr633803pll.160.1527216087059; Thu, 24 May 2018 19:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216087; cv=none; d=google.com; s=arc-20160816; b=x1cV7lHJnBvEhMCU0mny2A2cndCUCoyYbzmDCbEWqpzEO3lpVpMS2tZr9cfhTBA//H 2qn6YdNnGzxJgI4350kd2KPAq5BSXd167qrzsYeBM/RG+H8hPGab/EVd511D621DkvIW 5LegKvltg+Z53IvYmkkUREVhOYNa1JFNqIS+Gwx9Or1MbAzvNeAVZmZfEYJJfwjLFF6K +Do0rkXL5LkAccge/wtJO7S3YV5YUDMsHk5FbpCRYnILHetUuDldQU0c7jA0eY6an/Fv oWghjsjNenDDEaHAHu8xootoIUlEG82fvuf7IapvhLymQlkX3GaVKOSXp4/ymVwz5/nR 4ilQ== 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=Aq2wHH5RodPtcPYtuW34Ou/TAe7WePnxgyqvKg0lv9A=; b=cM+w6NQnDSZGq7jmi0yxzv5FoLM8vVnLg6fnUyv6KBBMQVLQASWwMGKq8hSPUDkLiM 0pJvkNTxsMvAiI38Xmp1DS+dO06xAQ026wIRmBsamaBBZR+rSrXtKok3thWpnKtksRad c/1h2THo4edXZLv5iTxxbNWXhWe557l1CysiBRhK9H3iZHKiWY/2jRWfZO7cS4aod1IZ SMmPkIy8TAOaxDiJYGOn4GL4HHbYbJoNVQYJ9zHSHSwhvnRrPQlhWbDZ3jES+rlT/NKe P2mjzF6CzdSXXm5Z3gCFBFDnjTkG8hiNwWJRiLxKMFUANfkNLEC8cDIwleF/QtT8VmxQ ax5g== 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 c23-v6si22830230pli.540.2018.05.24.19.41.12; Thu, 24 May 2018 19:41:27 -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 S971311AbeEXULZ (ORCPT + 99 others); Thu, 24 May 2018 16:11:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43204 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968724AbeEXULN (ORCPT ); Thu, 24 May 2018 16:11:13 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4OK4D51049623 for ; Thu, 24 May 2018 16:11:13 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j60rq9ep0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 May 2018 16:11:12 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 24 May 2018 16:11:11 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e17.ny.us.ibm.com (146.89.104.204) 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:08 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4OKB7dQ9306456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 May 2018 20:11:07 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A3A9BAC0E7; Thu, 24 May 2018 16:12:36 -0400 (EDT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 8D9DAAC0E3; Thu, 24 May 2018 16:12:36 -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 1/8] ima: Call audit_log_string() rather than logging it untrusted Date: Thu, 24 May 2018 16:10:58 -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-0040-0000-0000-000004317D47 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:09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052420-0041-0000-0000-000008379AE5 Message-Id: <20180524201105.3179904-2-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=1011 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 The parameters passed to this logging function are all provided by a privileged user and therefore we can call audit_log_string() rather than audit_log_untrustedstring(). Signed-off-by: Stefan Berger Suggested-by: Steve Grubb --- security/integrity/ima/ima_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index d89bebf85421..a823f11a3e6b 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -615,7 +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_untrustedstring(ab, value); + audit_log_string(ab, value); audit_log_format(ab, " "); } static void ima_log_string(struct audit_buffer *ab, char *key, char *value) -- 2.13.6