public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy()
       [not found] <20241029221641.15726-1-abdul.rahim.ref@myyahoo.com>
@ 2024-10-29 22:16 ` Abdul Rahim
  2024-10-30  5:57   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Abdul Rahim @ 2024-10-29 22:16 UTC (permalink / raw)
  To: krzk; +Cc: Abdul Rahim, netdev, linux-kernel

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(-)

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy()
  2024-10-29 22:16 ` [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy() Abdul Rahim
@ 2024-10-30  5:57   ` Krzysztof Kozlowski
  2024-11-25 20:41     ` Abdul Rahim
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-30  5:57 UTC (permalink / raw)
  To: Abdul Rahim; +Cc: netdev, linux-kernel

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy()
  2024-10-30  5:57   ` Krzysztof Kozlowski
@ 2024-11-25 20:41     ` Abdul Rahim
  2024-11-26  6:38       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Abdul Rahim @ 2024-11-25 20:41 UTC (permalink / raw)
  To: krzk; +Cc: abdul.rahim, linux-kernel, netdev

Do i need to resend it. What additional information do I need to
provide?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy()
  2024-11-25 20:41     ` Abdul Rahim
@ 2024-11-26  6:38       ` Krzysztof Kozlowski
  2024-11-26  8:49         ` Abdul Rahim
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26  6:38 UTC (permalink / raw)
  To: Abdul Rahim; +Cc: linux-kernel, netdev

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy()
  2024-11-26  6:38       ` Krzysztof Kozlowski
@ 2024-11-26  8:49         ` Abdul Rahim
  2024-11-26  9:22           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Abdul Rahim @ 2024-11-26  8:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: linux-kernel, netdev

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy()
  2024-11-26  8:49         ` Abdul Rahim
@ 2024-11-26  9:22           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26  9:22 UTC (permalink / raw)
  To: Abdul Rahim; +Cc: linux-kernel, netdev

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-26  9:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241029221641.15726-1-abdul.rahim.ref@myyahoo.com>
2024-10-29 22:16 ` [PATCH] nfc: s3fwrn5: Prefer strscpy() over strcpy() Abdul Rahim
2024-10-30  5:57   ` Krzysztof Kozlowski
2024-11-25 20:41     ` Abdul Rahim
2024-11-26  6:38       ` Krzysztof Kozlowski
2024-11-26  8:49         ` Abdul Rahim
2024-11-26  9:22           ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox