From patchwork Fri Jan 24 09:23:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C363C2D0DB for ; Fri, 24 Jan 2020 11:02:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E397820838 for ; Fri, 24 Jan 2020 11:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579863739; bh=mMVHWPhGVr12UQgiIwOVH1+KWsDTW8eU+eNqwVQThDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Kqrz4zAwQBrarNuTMqI+iajxu3kDVI3tHrZRYHtKIcpr7UVkzAV9qOtAIcoE0eOQo sV0uX0LxWeI0WKRD2l09exqT/yJlmxNxJAn8NrBO2zh5PyCdz+dOtcTDkslWVWjStD yzBXoGz7j3H5zE7HFsSjhMkp6c2/nq07JMPkxvtE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387978AbgAXLCN (ORCPT ); Fri, 24 Jan 2020 06:02:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:35562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732560AbgAXLCN (ORCPT ); Fri, 24 Jan 2020 06:02:13 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6BFDE2075D; Fri, 24 Jan 2020 11:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579863732; bh=mMVHWPhGVr12UQgiIwOVH1+KWsDTW8eU+eNqwVQThDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a5GergCa9/w7WXznR5J0lG7xZCIY8NFAMMnhquhsDbUeY3SZqFr0Rdm1cNvAuFfv6 I8R/1g5P+BAsjhy7oIsFa2JHNfVeVOhatkpXss2Zf7YuPFKRpnZxO8qCzbqQLHwVdN hg64asKFHLZRPY9r0fzxo4z6AlHYmMGz6hOXqSoA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Herbert Xu , Sasha Levin Subject: [PATCH 4.19 065/639] pcrypt: use format specifier in kobject_add Date: Fri, 24 Jan 2020 10:23:55 +0100 Message-Id: <20200124093055.548235479@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Colin Ian King [ Upstream commit b1e3874c75ab15288f573b3532e507c37e8e7656 ] Passing string 'name' as the format specifier is potentially hazardous because name could (although very unlikely to) have a format specifier embedded in it causing issues when parsing the non-existent arguments to these. Follow best practice by using the "%s" format string for the string 'name'. Cleans up clang warning: crypto/pcrypt.c:397:40: warning: format string is not a string literal (potentially insecure) [-Wformat-security] Fixes: a3fb1e330dd2 ("pcrypt: Added sysfs interface to pcrypt") Signed-off-by: Colin Ian King Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/pcrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c index f8ec3d4ba4a80..a5718c0a3dc4e 100644 --- a/crypto/pcrypt.c +++ b/crypto/pcrypt.c @@ -394,7 +394,7 @@ static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name) int ret; pinst->kobj.kset = pcrypt_kset; - ret = kobject_add(&pinst->kobj, NULL, name); + ret = kobject_add(&pinst->kobj, NULL, "%s", name); if (!ret) kobject_uevent(&pinst->kobj, KOBJ_ADD);