From patchwork Tue Oct 29 22:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdul Rahim X-Patchwork-Id: 13855589 X-Patchwork-Delegate: kuba@kernel.org Received: from sonic311-21.consmr.mail.sg3.yahoo.com (sonic311-21.consmr.mail.sg3.yahoo.com [106.10.244.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9477120606E for ; Tue, 29 Oct 2024 22:37:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=106.10.244.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730241433; cv=none; b=PYBdgi/oFqXBg9SyFp87NpNp7608cBjN0XxTdrzHlcYy0UAJgAu3/1weksEwYfgAn8Cz8AoPzVhPIwr+f5j6uuIQdACE6nn++f3yyNAeru6arerky6gp3pGCLsbWirONUO4DLKuBFGb1tVbANrhEU1vy+ncUJ3S3itna11CtlYg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730241433; c=relaxed/simple; bh=w7HW4iNMeHO932LTBNDZgLJxyPb5FGS1JRxdU0k+BxA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:References; b=TOaaIOnbq4C//gBaWAtdLUKRAm0S3KW9y4GeYMiIo1yHxwkV7XWgm8b5YdKjfqkSSaCHHzqDr5IqUDVMVRPo1g6YPZOGm2arW2PpOJeM651gWtBF+OEC1mnSWgS45rdQfYZ7HgcvWVcsO5Hq5/QI0qvAywGR8+HGWks7oVAlOIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=myyahoo.com; spf=pass smtp.mailfrom=myyahoo.com; dkim=pass (2048-bit key) header.d=myyahoo.com header.i=@myyahoo.com header.b=Ro6GcXx/; arc=none smtp.client-ip=106.10.244.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=myyahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=myyahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=myyahoo.com header.i=@myyahoo.com header.b="Ro6GcXx/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myyahoo.com; s=s2048; t=1730241429; bh=CANO7+oMA8nkkb8BNVFqkHt5bjmgbHDSwStgzlrk0qQ=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=Ro6GcXx/2XbHUXDkzSObKdFfUkqh6MbsGvhrVTPyXLNEeI5joNUA64uKUAQlzA3/wVEElfF85R+4U+5sBqCaJR4bsLgpkWN7B4HMn2v57Gc5tXqyqiV98tfg9P3fanbcQy0zZ9Xfcs8HfwNmO2WLYlb7pwew3oGjrzR9OLdPEfspVfLdNmnuKrMly4oiTLYkxgbIP0VzwaChKgFnlgOogeX1AyEs8sf4GfKJ6odFq0JEiwXBnN8Dv/lSaKmv6IJ6jw9tMfqIYauvcaFaduij345OSgf53Rlo60PRarVU5ErHsPcHjO1rXyuKEp2uNSzpD0b/Sh/nMGh6DERVt+2qow== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1730241429; bh=3SbcNv2gRCk6nEdfbmtRs9SDajxGzD5ezxbqg4fELyb=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=a3BkdiFI8RAALNlKG3H+/MpwwjSar23T3FMClw0JhHEngCWNFUJPMWC8erdKeMmU323CmePogv32+OKmn5ePnOtiE7D4sLezihDwKzZpuE/DJKO/Ix2u1RXffudPtilFFqJ6xKoWgWDiNQkh1cklYXpher4mj0Nu0dXCsRQqeHFPYaSoO7xw8MKdnSekTJEkoskoARbS7VusVGJRmSobFLcnO/vMRoZT39cHB8bMQnmyVtHAQdSRaIDj9s8HOor1/w9vJ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M4gPYuyIvCWxs4CkQ2.lOdqx6nqI MEMwZx7VVar_op.4c7IMderF7j5joLavR1B908lNPtWMUTi61S8xPltQzAIb3pVZyzUsMk6uzTtk BkMrjV.ToVR7bOCBUYeGmH_M4uOqMYdFtVcT35LqoaqIAc2ef6Nau9KyJuQC4C4NQI3QGOdpPwCG Lx_p7NHNlY.8OcUMXgrQAgnuYsL1oPe24i8aqY1k- X-Sonic-MF: X-Sonic-ID: 320644b0-bd48-41df-87f6-9d2cb6f7bc86 Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.sg3.yahoo.com with HTTP; Tue, 29 Oct 2024 22:37:09 +0000 Received: by hermes--production-sg3-5b7954b588-2czcw (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 30c7e69c8517e1fdffb1648896dbbb2f; Tue, 29 Oct 2024 22:16:48 +0000 (UTC) From: Abdul Rahim To: krzk@kernel.org Cc: Abdul Rahim , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy() Date: Wed, 30 Oct 2024 03:46:34 +0530 Message-ID: <20241029221641.15726-1-abdul.rahim@myyahoo.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20241029221641.15726-1-abdul.rahim.ref@myyahoo.com> X-Patchwork-Delegate: kuba@kernel.org strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors [1] this fixes checkpatch warning: WARNING: Prefer strscpy over strcpy Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Abdul Rahim Reviewed-by: Krzysztof Kozlowski --- drivers/nfc/s3fwrn5/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c index c20fdbac51c5..85fa84d93883 100644 --- a/drivers/nfc/s3fwrn5/firmware.c +++ b/drivers/nfc/s3fwrn5/firmware.c @@ -469,7 +469,7 @@ void s3fwrn5_fw_init(struct s3fwrn5_fw_info *fw_info, const char *fw_name) fw_info->parity = 0x00; fw_info->rsp = NULL; fw_info->fw.fw = NULL; - strcpy(fw_info->fw_name, fw_name); + strscpy(fw_info->fw_name, fw_name); init_completion(&fw_info->completion); }