Message ID | 20220818210123.7637-8-wsa+renesas@sang-engineering.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=SYrije4U; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.a=rsa-sha256 header.s=k1 header.b=gzh/xgve; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M7y7d0Yhjz1yg3 for <incoming@patchwork.ozlabs.org>; Fri, 19 Aug 2022 07:04:45 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4A3Oy6/o+AUYKKhNaJJErlYNNZGAXA4h2T0TTExhbs0=; b=SYrije4UzgEAAc OTr3sPzWalvBR26PnHZlSVADNmuTQjXUqqvQ86vilJC9ds5dNpskcpMq4ZetelSCh+lA58skqp+en ehW/brbKzY8mr0O+vqHsHncVkXhN0Sez3/N6mEei9htfRVaU+gY1NVw3uiavciUyas+rU9hZnvNqi WpV6hJ9sHSwIsw69U614qpEJoEEInTiiUyVCQuqzesgUOI/yTnq5hJbWkdvToOQZ2cUEFpgX+RYZ9 Ncg6YC9OpmaCOB5UwY4mHBldQF1rZiyxd/XEavgoJI+3UfcgqCLRcX44WZULjvnfZ2WHqkW2w9lSe l8ytJCly4P2cLLNZ7hxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOmgs-009ct4-PB; Thu, 18 Aug 2022 21:04:34 +0000 Received: from www.zeus03.de ([194.117.254.33] helo=mail.zeus03.de) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOmgp-009cox-7J for linux-um@lists.infradead.org; Thu, 18 Aug 2022 21:04:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=sO6GFXLR+dP7HE YmREgWHx8AWHlYypjTduLvwD5S2Pc=; b=gzh/xgve+IX2oZ/IM6H9d1Ow/Ln6yt bzV+Wf6V6bsR0Tt4TB4pFeTPo9iB9twjGGi5pTVeAPF8FSSMJa32wPgI0pU/obXM 3cRCTzFdCTHSPoK6kND3bLv0uz69YGBxQ50lIzpCSUqxIbKOWOW1uhHXLnNbjJSP 6TFWslaTHF5Sg= Received: (qmail 3962083 invoked from network); 18 Aug 2022 23:01:32 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:32 +0200 X-UD-Smtp-Session: l3s3148p1@adM3SYrmI7gucref From: Wolfram Sang <wsa+renesas@sang-engineering.com> To: linux-kernel@vger.kernel.org Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>, Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, linux-um@lists.infradead.org Subject: [PATCH 08/14] hostfs: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:17 +0200 Message-Id: <20220818210123.7637-8-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220818210123.7637-1-wsa+renesas@sang-engineering.com> References: <20220818210123.7637-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220818_140431_595853_E682B717 X-CRM114-Status: GOOD ( 10.17 ) X-Spam-Score: 0.8 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- fs/hostfs/hostfs_kern.c | 2 +- 1 [...] Content analysis details: (0.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [194.117.254.33 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 1.0 FORGED_SPF_HELO No description available. X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-um.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-um>, <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-um/> List-Post: <mailto:linux-um@lists.infradead.org> List-Help: <mailto:linux-um-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-um>, <mailto:linux-um-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" <linux-um-bounces@lists.infradead.org> Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
None
|
expand
|
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 07881b76d42f..277468783fee 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -103,7 +103,7 @@ static char *__dentry_name(struct dentry *dentry, char *name) */ BUG_ON(p + strlen(p) + 1 != name + PATH_MAX); - strlcpy(name, root, PATH_MAX); + strscpy(name, root, PATH_MAX); if (len > p - name) { __putname(name); return NULL;
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- fs/hostfs/hostfs_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)