From nobody Mon May 25 06:40:19 2026 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 7680B3C65E0 for ; Sun, 17 May 2026 17:26:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779038796; cv=none; b=DlCHZC81O2VErT+spUUPHCMSeikiOERPiYwnIOi2Ct0ql2wUE4iHp2GS1LTkLv7IqEMkJJ0Bu13ThsoRADNvSdWQQ0EQr5AugXl4bqaao5hK9HRPAPyZj18+Q619kdOYg9Vcjy4tDVN9FgmyfhP7OQ5Jqqb0/Wp2dwOjhQc2rA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779038796; c=relaxed/simple; bh=eJsfiUZLw3wmJYdoGds/9LxKqXLvl/zHbkZXEefuyqk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZQhxUx/rIs+fpGH3so89PYimamURCtPOag+vikI449QgRfVbTR1oxeMOzfvHpd98gORi63T3+LHT7PQQM09UFB03l1riIFZdOTktw3wwiEso37kgT7DSGylyQUzTGZzTqfhhctsIIo330u8M3qZ6PiTH488zS2LLs0qVnbV42EA= 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=fQj6T2Tw; arc=none smtp.client-ip=91.218.175.172 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="fQj6T2Tw" 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=1779038782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=76A0oZKKwfcdbs5aKjR8EbOiZitG9AezNjNS+0A/s0s=; b=fQj6T2TwMKYJU357KmZwNUZ9lZ6u9U4axvvwAgyKUDkRhlPmMkmz51+GD55aYMzQq3I58l eOhSl3ZsGuUVhxgDNcYW1Gib7IMaopqtmFgXSIYCLxdvkr/pnnDLMt4cQcArSrHtcVcRBE 4Fji3JBwwO8xk/ZOK8ri5SSCdmz6wP8= From: Thorsten Blum To: Jens Axboe Cc: Thorsten Blum , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] n64cart: use strscpy in n64cart_probe Date: Sun, 17 May 2026 19:26:17 +0200 Message-ID: <20260517172617.3954-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1160; i=thorsten.blum@linux.dev; h=from:subject; bh=eJsfiUZLw3wmJYdoGds/9LxKqXLvl/zHbkZXEefuyqk=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFmcvyxjduj/7+yQebn74XLzd/NXbj7tUqag6VdicWyes fQrVaZ/HaUsDGJcDLJiiiwPZv2Y4VtaU7nJJGInzBxWJpAhDFycAjCRpQ8ZGVbuEubryD2y5vtM laiTiw3Kfz0+5Dpt+8mtNSkMlh82LZ3D8If3UVNEeaGpkf7xdMUIua88ii5n3ncekc6bEe+U5sq UwAcA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 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. While the current code works correctly, replace strcpy() with the safer strscpy() to follow secure coding best practices. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy Signed-off-by: Thorsten Blum --- drivers/block/n64cart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index b9fdeff31caf..328da73b6f2c 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -12,6 +12,7 @@ #include #include #include +#include =20 enum { PI_DRAM_REG =3D 0, @@ -145,7 +146,7 @@ static int __init n64cart_probe(struct platform_device = *pdev) disk->flags =3D GENHD_FL_NO_PART; disk->fops =3D &n64cart_fops; disk->private_data =3D &pdev->dev; - strcpy(disk->disk_name, "n64cart"); + strscpy(disk->disk_name, "n64cart"); =20 set_capacity(disk, size >> SECTOR_SHIFT); set_disk_ro(disk, 1);