From nobody Fri Apr 10 21:56:00 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97A80C00140 for ; Thu, 18 Aug 2022 21:14:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347034AbiHRVOM (ORCPT ); Thu, 18 Aug 2022 17:14:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240939AbiHRVKM (ORCPT ); Thu, 18 Aug 2022 17:10:12 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19C07D39B5 for ; Thu, 18 Aug 2022 14:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=sO6GFXLR+dP7HEYmREgWHx8AWHl YypjTduLvwD5S2Pc=; b=kT7ZihOzI1uJTwZ8xrXAYr/tJ+ShEQDBAsc3sxrBmSQ 1MT2Dd9BzMJ3S2hF2sw9wsubWf24BNMEkDEV286DeVKwWTqulbM6q8ubB0ICd3WN f/8eZwmGp0Td0vHjFxkOElDyZ/nMDU+ImZLHj+2DOdi6uXHOmgt2ixBGDyexHByE = Received: (qmail 3962351 invoked from network); 18 Aug 2022 23:01:46 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:46 +0200 X-UD-Smtp-Session: l3s3148p1@tC0MSormX5cucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org Subject: [PATCH] hostfs: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:45 +0200 Message-Id: <20220818210145.7939-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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-=3DwgfRnXz0W3D37d01q3JFkr_i_uTL=3DV6A6= G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang --- fs/hostfs/hostfs_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 !=3D name + PATH_MAX); =20 - strlcpy(name, root, PATH_MAX); + strscpy(name, root, PATH_MAX); if (len > p - name) { __putname(name); return NULL; --=20 2.35.1