From patchwork Sun May 7 13:41:14 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: 9715655 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 A6DD160365 for ; Sun, 7 May 2017 23:40:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 814BD22BF1 for ; Sun, 7 May 2017 23:40:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 616BB26419; Sun, 7 May 2017 23:40:00 +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 08F5A22BF1 for ; Sun, 7 May 2017 23:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751433AbdEGXj7 (ORCPT ); Sun, 7 May 2017 19:39:59 -0400 Received: from mout.web.de ([212.227.15.14]:56004 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbdEGXj6 (ORCPT ); Sun, 7 May 2017 19:39:58 -0400 Received: from [192.168.1.3] ([77.182.161.211]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lnmpz-1dgztT1zmJ-00hsx6; Sun, 07 May 2017 15:41:16 +0200 Subject: [PATCH 1/3] ima: Use seq_putc() in ima_ascii_measurements_show() 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: <6d0e528b-dc78-7927-1820-a6eaf5c7cb02@users.sourceforge.net> Date: Sun, 7 May 2017 15:41:14 +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:nxSHypotBDEhWhqDXVJr5l98yHUfnWVocCNw4coTv2rJ/HVxrlU Vzk8VaH1guEvtqa0QpaZJ5V6ICuLqgNwjVdFoVI20NKGQYHLDS5aB72oPqvIL3iFdbGwNlm 3CcwvB8cqDPwJ2XRyHsgFS9psEi25yh1XCS2J2QXj2R3vRBnXhuHbQkr5/Z6B3ynSnXqXH9 gDiOIcnZM+ZrQoobzBX7g== X-UI-Out-Filterresults: notjunk:1; V01:K0:LJg9JKjk5D8=:dSe3Xgvt6hgQXQtGO3VyiA 0gGe9FPvxuj04Bs6BsQHsgBOwrQRZwxjrDyLUpBqfntqvk4u698gnfbNRVlxgUv7ZxJ3VYWLb zrPqAB7e3ff7jo4dPXS3U22CpTJu26dKv/clAehlNnDQZjcGPbWFwIrmYQ7EBSvEe+2LrLTZI Se7BNkCx7DgXv0SYC+hZlWCl/ThMYzLJt+PpxyLjAyVFetOAuUMvmV81JBA3V4JsHjXzvD2PI ZV1aq4o/IppLSuxtRhwirpE5ijSizPowYlwvQ9Rdam58TpHqOwIUuRomGcLRSouyUd2Xf0pbM asniqnAcT6UQHCbbDfaKzFCNHGxpd+yaNBjmqbBbkN4/9x6b6+CW/KxWnsPQDXnlaX9Yggmqh mEeJjcsMs08SAU6JCtS3RWeWH9QELQXeLQ8Xrfh5PKP3oUroWGK1RK5DMN9rWDwNQFQy0vSb1 n1s4UqeGgega0vg0kX06jJH9fGX7vztCLy9dejXRt0SUfGsE2H4wzmr2+bwO+K9QQmU9e2XpL iGVBiu+GkoF5aP94YSF6Wlci3XTYGV5vcFlcJUQe7a3sfek9OONlePc3OBZEhhomtSE49nQde 70L3RhP+LxbmZN5wLV4cZYfTk2Ho4DbxUYqxX36WVnTdNFJ2Xy8YuawV9NpwWRxGY2rHkFJ2H HxUHlvbMncEnzSDJQrlbWngy+Me4U4yjZLU9YlkC/O26NILDrVxAuudfREq8iuiKYSmN+lM61 oiS7qv7FxCZH0d78fSaOEY3HBA0pSJ+jxkPd8nazNLFXh8xuMJggF6S79RE+e7L1+LW2QdTlG Y2UhmYR 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 14:45:01 +0200 Two 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_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c index ca303e5d2b94..732b5cd27042 100644 --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c @@ -242,14 +242,14 @@ static int ima_ascii_measurements_show(struct seq_file *m, void *v) /* 4th: template specific data */ for (i = 0; i < e->template_desc->num_fields; i++) { - seq_puts(m, " "); + seq_putc(m, ' '); if (e->template_data[i].len == 0) continue; e->template_desc->fields[i]->field_show(m, IMA_SHOW_ASCII, &e->template_data[i]); } - seq_puts(m, "\n"); + seq_putc(m, '\n'); return 0; }