From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17E461A2C00; Tue, 18 Jun 2024 13:12:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718716379; cv=none; b=YEEw9TzMM6urddCFDUuNUZ4TUWPJcgm5dS2rdtUnPitfVHniOmJ14WItRCmZTmgO+D57EprXz2kOX4GwZJOScSFr3UWUujx5z2N/we8yF6vRgNKg5fDzBxLbqWfaSfhObgA+s8/iNfZtgA4uaXvkGZz2l3WuFOCTOXhjf3g+EMU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718716379; c=relaxed/simple; bh=pj1E2M9TjX3YPR3i98oVOugs4lwT8iP1di/ZD8AnlSk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mI3nMMkvLJxwDI2FxHaPHt3LO82U1O3viraPL2X7dV4PDoS/jA80QobJMw2V4FSsny4sDnIusvPVdeWRyOigc7aZpMoWFTczxgt83a2NUZjCdbguPr/eIdbMRIHPdKW3i6SDjZlh1MQCeXaIOc/5z/fGxqI7ywhNtTAde1XO96A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iTL9z3NX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="iTL9z3NX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94FD2C3277B; Tue, 18 Jun 2024 13:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718716379; bh=pj1E2M9TjX3YPR3i98oVOugs4lwT8iP1di/ZD8AnlSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iTL9z3NXhBoLrmqnR2G2aqlFZT1zzL4m3cSZvTQJkRkvQJronHhJwGh9nE+M+YxbG u6AqxLmlITEUiicNEx7ME7QWuFl/4ir3JTl9oA3lEtYSSOFnz1RBODwU0yrl3LhsNg pDKsmP3BXOCyf2Vbj5X4I76FMm7FLWV1rqEUJD5U= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wolfram Sang , Chuck Lever , Sasha Levin Subject: [PATCH 5.10 627/770] lockd: move from strlcpy with unused retval to strscpy Date: Tue, 18 Jun 2024 14:38:00 +0200 Message-ID: <20240618123431.488465789@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618123407.280171066@linuxfoundation.org> References: <20240618123407.280171066@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wolfram Sang [ Upstream commit 97f8e62572555f8ad578d7b1739ba64d5d2cac0f ] 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 Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- fs/lockd/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/lockd/host.c b/fs/lockd/host.c index f802223e71abe..cdc8e12cdac44 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -164,7 +164,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni, host->h_addrbuf = nsm->sm_addrbuf; host->net = ni->net; host->h_cred = get_cred(ni->cred); - strlcpy(host->nodename, utsname()->nodename, sizeof(host->nodename)); + strscpy(host->nodename, utsname()->nodename, sizeof(host->nodename)); out: return host; -- 2.43.0