From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (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 3FB8E33993; Tue, 23 Dec 2025 21:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766523626; cv=none; b=gNlSV4C4QCIMvt5sVcScETlZi0CC0gdUEChVJnlTs100b2de03M7QqlIvoC4ITdyaCXHypkuHQbuZ5kzuDMx2mEC3uVxS39FcXjA+mrAkcFuolXhujNdLl6/rsLIWP8GSeeHXaCnAGvNKLlukOQJ6Iqvx3Ogr44CRHfsj9U4AiQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766523626; c=relaxed/simple; bh=1+kImc52QW/MLATL6kSK4BWrIpt3MTApOO7Bys0Nstg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gMYwMyHHxx0YPFqIVAtxkzn7AQKHsa9ViOCQqTvpUgYtECIcWiK+wAf/YqvEv5B3rl06uQIEMYQNhzrek28OjZFzxOUmXuhdh1wuISa6D+5iIB2VihaHSEFFmo8FecaN2EcdRmLhdMlMJPWxJmyeqYlXe1tr7jZYZJwlWoqKJqQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tyhicks.com; spf=pass smtp.mailfrom=tyhicks.com; dkim=pass (2048-bit key) header.d=tyhicks.com header.i=@tyhicks.com header.b=QPhZyY7I; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ksq7lKvU; arc=none smtp.client-ip=202.12.124.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tyhicks.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tyhicks.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tyhicks.com header.i=@tyhicks.com header.b="QPhZyY7I"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ksq7lKvU" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 785DC7A0125; Tue, 23 Dec 2025 16:00:22 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 23 Dec 2025 16:00:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tyhicks.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1766523622; x=1766610022; bh=bFtG1lf84D 6xJMXShoI8fXuAfz7L2gisaWCA6ZiiNxg=; b=QPhZyY7IEiOCnJksbkMCkl8vW3 T4AAD2Yxw9Q0Gt8zAZR5fHukuE6OpcnXy2GbvF3l7mAqCIV5ahTKNrkqvPvDfH5y OoNEZB5iQ5kG7KXU3s0Xp0MGpPD6nxugv+tAHsu/2SQdtykyMs/KPBkr/7QLEns8 kqKVlanAj2cgxuV6oD6yAd11L295r0rUMowERhSdG664AvkAyww6QmHN7bspExQe x/ds3Yk13UOHyPXVgUiDENnpxgDgu3KqGocXlMpDDkWaR48lJbI0ChenVNRgFHU8 lLbx9qH9amjzsbaoHvrIckOhBQWpE4I7e6vA+ycdy2KuOvlCJa/rUxv5WrKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1766523622; x=1766610022; bh=bFtG1lf84D6xJMXShoI8fXuAfz7L2gisaWC A6ZiiNxg=; b=ksq7lKvU80vdvwFLEu7B2MgmkhTsM+cTF2cQIo1Ue/UQ7ivYzRc eiakP9xjsPZBzm7NYugnUXrdnCINI9B6WetqZ7KBTsaEh/A93KxzXeXy481cWAFu ogxkraRXo4lUL+i8hqG/U+ct3DqhzkSYvvmYrP5ptonRHvPCWZfVP76SsB8ahflL RTfv2ho3QuytYBzHBoyrRHdg8FtqaDut5xbROVZOf5ONRpnXxrN76kVbS2E5JaWx tafc88XhtoI/kMaKoKX6KEt7owshYRky7VrKhuUbleMxUlRI0dKrb2OUYjxTOQGJ 6ZiCxC2e/DpJNBn8ZaHViyZDRV+eTeCSbhg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeitdekgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefvhihlvghrucfj ihgtkhhsuceotghouggvsehthihhihgtkhhsrdgtohhmqeenucggtffrrghtthgvrhhnpe fggeekieffteehgfetffduhfefjeehvdejhfejkeduleffudelhfefkeeiledujeenucff ohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheptghouggvsehthihhihgtkhhsrdgtohhmpdhnsggprhgt phhtthhopeekpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehthhhorhhsthgvnh drsghluhhmsehlihhnuhigrdguvghvpdhrtghpthhtohepsghrrghunhgvrheskhgvrhhn vghlrdhorhhgpdhrtghpthhtohepvhhirhhoseiivghnihhvrdhlihhnuhigrdhorhhgrd hukhdprhgtphhtthhopegrnhhkihhttghhrghuhhgrnhdvtdeiheesghhmrghilhdrtgho mhdprhgtphhtthhopegvsghighhgvghrsheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoh eprghruggssehkvghrnhgvlhdrohhrghdprhgtphhtthhopegvtghrhihpthhfshesvhhg vghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvh hgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i78e14604:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 Dec 2025 16:00:21 -0500 (EST) Date: Tue, 23 Dec 2025 15:00:19 -0600 From: Tyler Hicks To: Thorsten Blum Cc: Christian Brauner , Al Viro , Ankit Chauhan , Eric Biggers , Ard Biesheuvel , ecryptfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] ecryptfs: Replace strcpy with strscpy in ecryptfs_validate_options Message-ID: References: <20251213110502.302950-2-thorsten.blum@linux.dev> <20251213110502.302950-6-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: ecryptfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251213110502.302950-6-thorsten.blum@linux.dev> On 2025-12-13 12:04:54, Thorsten Blum wrote: > strcpy() has been deprecated [1] because it performs no bounds checking > on the destination buffer, which can lead to buffer overflows. Replace > it with the safer strscpy(). > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] > Signed-off-by: Thorsten Blum Acked-by: Tyler Hicks > --- > fs/ecryptfs/main.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c > index 16ea14dd2c62..636aff7a48cf 100644 > --- a/fs/ecryptfs/main.c > +++ b/fs/ecryptfs/main.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > #include > #include "ecryptfs_kernel.h" > > @@ -353,13 +354,13 @@ static int ecryptfs_validate_options(struct fs_context *fc) > int cipher_name_len = strlen(ECRYPTFS_DEFAULT_CIPHER); > > BUG_ON(cipher_name_len > ECRYPTFS_MAX_CIPHER_NAME_SIZE); > - strcpy(mount_crypt_stat->global_default_cipher_name, > - ECRYPTFS_DEFAULT_CIPHER); > + strscpy(mount_crypt_stat->global_default_cipher_name, > + ECRYPTFS_DEFAULT_CIPHER); > } > if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) > && !ctx->fn_cipher_name_set) > - strcpy(mount_crypt_stat->global_default_fn_cipher_name, > - mount_crypt_stat->global_default_cipher_name); > + strscpy(mount_crypt_stat->global_default_fn_cipher_name, > + mount_crypt_stat->global_default_cipher_name); > if (!ctx->cipher_key_bytes_set) > mount_crypt_stat->global_default_cipher_key_size = 0; > if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) > -- > Thorsten Blum > GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4 >