diff mbox series

nfc: s3fwrn5: Prefer strscpy() over strcpy()

Message ID 20241029221641.15726-1-abdul.rahim@myyahoo.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series nfc: s3fwrn5: Prefer strscpy() over strcpy() | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 2 of 2 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Abdul Rahim Oct. 29, 2024, 10:16 p.m. UTC
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 <abdul.rahim@myyahoo.com>
---
 drivers/nfc/s3fwrn5/firmware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Kozlowski Oct. 30, 2024, 5:57 a.m. UTC | #1
On 29/10/2024 23:16, Abdul Rahim wrote:
> 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

You should explain why it is safe to omit the destination buffer size.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Abdul Rahim Nov. 25, 2024, 8:41 p.m. UTC | #2
Do i need to resend it. What additional information do I need to
provide?
Krzysztof Kozlowski Nov. 26, 2024, 6:38 a.m. UTC | #3
On 25/11/2024 21:41, Abdul Rahim wrote:
> Do i need to resend it. What additional information do I need to
> provide?


You cut entire email, no clue what's this.

Best regards,
Krzysztof
Abdul Rahim Nov. 26, 2024, 8:49 a.m. UTC | #4
On Tue, Nov 26, 2024 at 07:38:43AM +0100, Krzysztof Kozlowski wrote:
> On 25/11/2024 21:41, Abdul Rahim wrote:
> > Do i need to resend it. What additional information do I need to
> > provide?
> 
> 
> You cut entire email, no clue what's this.
> 
> Best regards,
> Krzysztof
> 

Do I need to resend this patch [1]. You gave it `Reviewed-by` tag. But
it's not applied yet.

[1]: https://lore.kernel.org/lkml/20241029221641.15726-1-abdul.rahim@myyahoo.com/

Thanks,
Abdul
Krzysztof Kozlowski Nov. 26, 2024, 9:22 a.m. UTC | #5
On 26/11/2024 09:49, Abdul Rahim wrote:
> On Tue, Nov 26, 2024 at 07:38:43AM +0100, Krzysztof Kozlowski wrote:
>> On 25/11/2024 21:41, Abdul Rahim wrote:
>>> Do i need to resend it. What additional information do I need to
>>> provide?
>>
>>
>> You cut entire email, no clue what's this.
>>
>> Best regards,
>> Krzysztof
>>
> 
> Do I need to resend this patch [1]. You gave it `Reviewed-by` tag. But
> it's not applied yet.
> 
> [1]: https://lore.kernel.org/lkml/20241029221641.15726-1-abdul.rahim@myyahoo.com/
First, it is merge window, no point to ping during that time. It is
actually highly discouraged, unless this is a fix. And it is not a fix.

Second, this should have net-next PATCH prefix, see subsystem profile
for networking.

I asked to change things in commit msg, so I expect next version, not
resend.

Best regards,
Krzysztof
diff mbox series

Patch

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);
 }