From patchwork Sun May 7 13:43:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9715651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A6DF60380 for ; Sun, 7 May 2017 23:35:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FCE922B26 for ; Sun, 7 May 2017 23:35:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4320D26419; Sun, 7 May 2017 23:35:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD0EB22B26 for ; Sun, 7 May 2017 23:35:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751433AbdEGXft (ORCPT ); Sun, 7 May 2017 19:35:49 -0400 Received: from mout.web.de ([212.227.15.3]:52927 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbdEGXfs (ORCPT ); Sun, 7 May 2017 19:35:48 -0400 Received: from [192.168.1.3] ([77.182.161.211]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LvB2o-1e6a7b2WIM-010Khg; Sun, 07 May 2017 15:43:17 +0200 Subject: [PATCH 3/3] ima: Replace nine seq_puts() calls by seq_putc() From: SF Markus Elfring To: linux-ima-devel@lists.sourceforge.net, linux-ima-user@lists.sourceforge.net, linux-security-module@vger.kernel.org, Dmitry Kasatkin , James Morris , Mimi Zohar , "Serge E. Hallyn" Cc: LKML , kernel-janitors@vger.kernel.org References: <416e6b01-7abb-d894-3bd6-d8bda05ed6b2@users.sourceforge.net> Message-ID: <1e549540-9160-6f9f-af39-d06b1c75a24d@users.sourceforge.net> Date: Sun, 7 May 2017 15:43:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <416e6b01-7abb-d894-3bd6-d8bda05ed6b2@users.sourceforge.net> Content-Language: en-US X-Provags-ID: V03:K0:DNYxSyDuOnbR43+etYMtBP4nqHvIUwSz3l+Q27ZvNjR+YOnG7Dr SGR8WLgxvvjINQ+3kWY2wDGB6DZZrgBl+QXelG9NXyp1rnzOiAo1YUuI4d0wX07Hn5kpn02 GQAlj35O2MQ0X1a5GAZZtfg0qKSEs05npcoDT61+FxKKxgANFyI/+TswwscY0AeEOOxBOe0 aIt6aM412Gc5e+JMnw1pQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:rHOe7A0SPD0=:SbqeVhRDnID7oSBRk1+VeV k3UmxQ9uvTGdc8wbnQhPAeRTMyol21NGnm2LWM1U6A7DwsQjXqyOWXXip0BdpRq1Q+JSqaL7n HE6D2B/yT2Hnc8YUAnGZZpiVA/ndqiB3S0lywWe/eVhd51qTRaB653AncTT/vVRY67WB4pzXJ /Foh4ctTpBx4NOdF+h/fQ/oEPcMVmx0EkQpHlOsG+eHHOv6THeaHHiLxsMcbfoJbxpVr2FXNL v88eRnKM57qU0wQ5RwULuyj4xA4LLdoLnAn5aQlwX6goLBTfTO/cWbFcdQjeo6HZOQLvzGasO iMXnMCDxniV01SOU8zMq+FHSLoHE2tAJQao6pmqJ/LTb8n4jv4Rkvow4JGJshENw6iipsmzuE 0NvDILW7VH1lWwnuO1iwisirW+kXfzHHl56xcLxWVwIxV1sRvh7WyX1Q45/CxKd9lSkZzHxg1 c6OTucb1QTWe05JD7tD/6ly725qnhR6DLJf3WE6HGhxoAoF/ofT3ba+EUiqQ2pZZIjlnyiEpD qTl0mbUNzx7bJHXyFJHDi4OjU4sm/ARYdlz5jOLNNpsC+0/ZSy+TAsqYY+ct6nf/gocvOid8P E8GhjgwsjZ92m47bKpEk+JqrCv/qUV1ynz5UiaFvPoo6DNnhOoRjwqT4aJ6vddlGf5p3tQ22M 7E+zR+fPCWlK2emCGeU0mdC5SfR34qm/eE2BY7tvs+cg/H/q4woGYtHcvlv3R7T9uzSbHdZ32 KKMYsw1pW+/op2+GEXClqhez+AChvE8iHALroAvPo3TvmkB8/q34kgKhJoiBNVEc65GIUHcVw IzYP10i Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 7 May 2017 15:23:44 +0200 Nine single characters should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- security/integrity/ima/ima_policy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 83446a383ace..b1ec6f2ce0ad 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -1035,7 +1035,7 @@ static void policy_func_show(struct seq_file *m, enum ima_hooks func) seq_printf(m, pt(Opt_func), tbuf); break; } - seq_puts(m, " "); + seq_putc(m, ' '); } int ima_policy_show(struct seq_file *m, void *v) @@ -1057,7 +1057,7 @@ int ima_policy_show(struct seq_file *m, void *v) if (entry->action & AUDIT) seq_puts(m, pt(Opt_audit)); - seq_puts(m, " "); + seq_putc(m, ' '); if (entry->flags & IMA_FUNC) policy_func_show(m, entry->func); @@ -1071,19 +1071,19 @@ int ima_policy_show(struct seq_file *m, void *v) seq_printf(m, pt(Opt_mask), mt(mask_read)); if (entry->mask & MAY_APPEND) seq_printf(m, pt(Opt_mask), mt(mask_append)); - seq_puts(m, " "); + seq_putc(m, ' '); } if (entry->flags & IMA_FSMAGIC) { snprintf(tbuf, sizeof(tbuf), "0x%lx", entry->fsmagic); seq_printf(m, pt(Opt_fsmagic), tbuf); - seq_puts(m, " "); + seq_putc(m, ' '); } if (entry->flags & IMA_PCR) { snprintf(tbuf, sizeof(tbuf), "%d", entry->pcr); seq_printf(m, pt(Opt_pcr), tbuf); - seq_puts(m, " "); + seq_putc(m, ' '); } if (entry->flags & IMA_FSUUID) @@ -1097,7 +1097,7 @@ int ima_policy_show(struct seq_file *m, void *v) seq_printf(m, pt(Opt_uid_lt), tbuf); else seq_printf(m, pt(Opt_uid_eq), tbuf); - seq_puts(m, " "); + seq_putc(m, ' '); } if (entry->flags & IMA_EUID) { @@ -1108,7 +1108,7 @@ int ima_policy_show(struct seq_file *m, void *v) seq_printf(m, pt(Opt_euid_lt), tbuf); else seq_printf(m, pt(Opt_euid_eq), tbuf); - seq_puts(m, " "); + seq_putc(m, ' '); } if (entry->flags & IMA_FOWNER) { @@ -1119,7 +1119,7 @@ int ima_policy_show(struct seq_file *m, void *v) seq_printf(m, pt(Opt_fowner_lt), tbuf); else seq_printf(m, pt(Opt_fowner_eq), tbuf); - seq_puts(m, " "); + seq_putc(m, ' '); } for (i = 0; i < MAX_LSM_RULES; i++) { @@ -1157,7 +1157,7 @@ int ima_policy_show(struct seq_file *m, void *v) if (entry->flags & IMA_PERMIT_DIRECTIO) seq_puts(m, "permit_directio "); rcu_read_unlock(); - seq_puts(m, "\n"); + seq_putc(m, '\n'); return 0; } #endif /* CONFIG_IMA_READ_POLICY */