From nobody Sun Feb 8 11:45:50 2026 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 73B3E30C61F for ; Mon, 22 Dec 2025 10:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766397687; cv=none; b=IlW7dILgBCK5Gxh/nMmJ1W/mztopyEEYcJJKKOj0fdwlVS4l30VXbR2yjh2lpZVmyLf6sBB0BEtcWGpGinN3P0ARFqin2eT2OpyZmjQQFNO0mYzJ6oy0rqOI1VrI3/FE6QGSPDrATxBEQrvL70WIjztB239Mhf1qwVRP83HO+tQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766397687; c=relaxed/simple; bh=CpxdSoJI0VdpwD6b5u94AM57t4vZuXSjuprd1Xl9xDQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Up3VVCCQc0+sB2zsIQg4uRF08McdtkD4KohiE8PpSabuDscfJ4HhsLJp7ioTk7MNbSGSLPUdZu6a2uchcyJpJKOYSG2IkMBMKD8QBb9YWcPzJUUWPqL8bK+G5K0Xc4pB5lmjC4lcD8z8SoiBmjFyKz3qzKGGWjHrDIMFthrDfBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=aF+AH0mE; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="aF+AH0mE" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1766397682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/Y8rlZ0MqBmi2TDIIITz2NWyLpQSUXkNV5dxL70pke4=; b=aF+AH0mEUK0aQvs7qE5CL7zHspIwCD9sCHSribPK4unk7C09v3A8sXA3f4O3r10N7sI64j sMts4W/unqYecd59lhZfWpDWkkrhi1g+GdBeahI8W5BM/77nvoPL9xpGGhjAA3pItI5vc8 mMCcsqm1TFlb0mMJ22IFhTGaut7eQP0= From: Thorsten Blum To: Mike Marshall , Martin Brandenburg Cc: Thorsten Blum , devel@lists.orangefs.org, linux-kernel@vger.kernel.org Subject: [PATCH] orangefs: Replace deprecated strcpy with strscpy Date: Mon, 22 Dec 2025 11:00:57 +0100 Message-ID: <20251222100057.633988-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" 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(). No functional changes. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy= [1] Signed-off-by: Thorsten Blum --- fs/orangefs/xattr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index eee3c5ed1bbb..a431aa07a229 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c @@ -152,7 +152,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, co= nst char *name, goto out_unlock; =20 new_op->upcall.req.getxattr.refn =3D orangefs_inode->refn; - strcpy(new_op->upcall.req.getxattr.key, name); + strscpy(new_op->upcall.req.getxattr.key, name); =20 /* * NOTE: Although keys are meant to be NULL terminated textual @@ -173,7 +173,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, co= nst char *name, (char *)new_op->upcall.req.getxattr.key); cx =3D kmalloc(sizeof *cx, GFP_KERNEL); if (cx) { - strcpy(cx->key, name); + strscpy(cx->key, name); cx->length =3D -1; cx->timeout =3D jiffies + orangefs_getattr_timeout_msecs*HZ/1000; @@ -220,14 +220,14 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, = const char *name, ret =3D length; =20 if (cx) { - strcpy(cx->key, name); + strscpy(cx->key, name); memcpy(cx->val, buffer, length); cx->length =3D length; cx->timeout =3D jiffies + HZ; } else { cx =3D kmalloc(sizeof *cx, GFP_KERNEL); if (cx) { - strcpy(cx->key, name); + strscpy(cx->key, name); memcpy(cx->val, buffer, length); cx->length =3D length; cx->timeout =3D jiffies + HZ; @@ -267,7 +267,7 @@ static int orangefs_inode_removexattr(struct inode *ino= de, const char *name, * textual strings, I am going to explicitly pass the * length just in case we change this later on... */ - strcpy(new_op->upcall.req.removexattr.key, name); + strscpy(new_op->upcall.req.removexattr.key, name); new_op->upcall.req.removexattr.key_sz =3D strlen(name) + 1; =20 gossip_debug(GOSSIP_XATTR_DEBUG, @@ -361,7 +361,7 @@ int orangefs_inode_setxattr(struct inode *inode, const = char *name, * strings, I am going to explicitly pass the length just in * case we change this later on... */ - strcpy(new_op->upcall.req.setxattr.keyval.key, name); + strscpy(new_op->upcall.req.setxattr.keyval.key, name); new_op->upcall.req.setxattr.keyval.key_sz =3D strlen(name) + 1; memcpy(new_op->upcall.req.setxattr.keyval.val, value, size); new_op->upcall.req.setxattr.keyval.val_sz =3D size; --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4