From patchwork Sun May 7 13:42:18 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: 9715639 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 3409A60380 for ; Sun, 7 May 2017 23:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25A4526224 for ; Sun, 7 May 2017 23:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A55F26419; Sun, 7 May 2017 23:31:02 +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 C941726224 for ; Sun, 7 May 2017 23:31:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752193AbdEGXbA (ORCPT ); Sun, 7 May 2017 19:31:00 -0400 Received: from mout.web.de ([212.227.15.4]:57584 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751341AbdEGXa7 (ORCPT ); Sun, 7 May 2017 19:30:59 -0400 Received: from [192.168.1.3] ([77.182.161.211]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LgHf2-1dsm4m1Tka-00niy9; Sun, 07 May 2017 15:42:20 +0200 Subject: [PATCH 2/3] ima: Combine two function calls into one in ima_policy_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: Date: Sun, 7 May 2017 15:42:18 +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:Ux1sfgMM5TwzruCVScLXPrVybofFxNmX+XBEjvWfJfrwNLrSbql YmFRDsR4ScaIOgMdzqQi7uYdWooJCKc9E/kqMKeAxEQZLjz6xHIGrxebWQmgyZYYaA/sTaP eY1OgiAGVbpm9P32eEWQcbsqRC65ch5frQNJ6S89qZz/9HBO/ZHLYhYNyI18SzHsoGuWx4O ynFLhXzOVhn8xElH4+JPA== X-UI-Out-Filterresults: notjunk:1; V01:K0:lnvw4XQQmiE=:eVrgigSWhiRFDWFIRsWyN3 k724Rmc115ttjf9kPkQuUPhb7SfrWlT8TEDkWlfcXLLkkZVWbLvhkEzMb/5QlveJPxExd59ZC sjjHBpeMW//pEZ03tzURPRBBJDaMtqQ7mu6IArNg+n+d5CQuIQrv8PIXe85Uju7cgZh3Bsy+N D5egplUgqqxYHLx6VRP32fEJYGe+Y0w9ahSo9dT0WNxWPOBXb8ND6MfPjjzI8fSEQksZlTERv r5i7qgpnKbx4sFM1DLg+iGmKIYUmTY7eHENoVb/cftP5CS7D7+sTmsL8tBSS1l6XM+NDr0syC vDFx8xL/Bn/bN1h9Lg7MnMl75pLMFvDuTXNulEPmTz+bXL7nPjCedi8Q0dSEQwjNAcuDT9QXt 1GHZkJlV81rtgKqWLRaEQ8cfh5yb1dHFP675VpVj6+vSts7PqYo62Hf+pUimTxuD6SW7VRX8L hl6cjs/iUf/klYDBEavVBhM0fLCiVpSBV0PAl/+ixODLuq0DD1tyC1zbdhyBKr0E9uom+QS9x vocdNucgSpzvPTSZSiz9whTwsrzQyzFz7qORPKpizRWvf6mHp/5SL4GomAgJqLvDPZuliYFwQ o3sui4WwUYHDIzKRKP6z0t51ElJUfRl/z9lQk+xT45aIrSUUjDrqMNKyyQXcRhwVKgxaNAWvr aDfODgNaU4XmDqdIW1LfRhnOK98bQzPaRcr5H7WoEjYNWkBgj4CSPCkBunox8B59e34GI/0SU ip/YGe0mzgS1zpnqzYBLQjaRcJZunvKcpwaGWSWBQ8dkEfX9sG5bk7xr15d197z3huJmwS/3X YCMNhqW 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:58:55 +0200 A bit of data was put into a sequence by two separate function calls. Print the same data by a single function call instead. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- security/integrity/ima/ima_policy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 3ab1067db624..83446a383ace 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -1086,10 +1086,8 @@ int ima_policy_show(struct seq_file *m, void *v) seq_puts(m, " "); } - if (entry->flags & IMA_FSUUID) { - seq_printf(m, "fsuuid=%pU", entry->fsuuid); - seq_puts(m, " "); - } + if (entry->flags & IMA_FSUUID) + seq_printf(m, "fsuuid=%pU ", entry->fsuuid); if (entry->flags & IMA_UID) { snprintf(tbuf, sizeof(tbuf), "%d", __kuid_val(entry->uid));