* [PATCH] rpmsg: glink: Replace strcpy() with strscpy()
@ 2025-12-11 8:48 Vishnu Santhosh
2026-01-30 0:25 ` Chris Lew
2026-07-10 18:07 ` Bjorn Andersson
0 siblings, 2 replies; 3+ messages in thread
From: Vishnu Santhosh @ 2025-12-11 8:48 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, deepak.singh, chris.lew
Cc: linux-arm-msm, linux-remoteproc, linux-kernel, Sudeepgoud Patil,
Vishnu Santhosh
From: Sudeepgoud Patil <quic_sudeepgo@quicinc.com>
Replace strcpy() with the safer strscpy() to address unsafe API
usage warnings[1] from static analysis tools, as strcpy() performs
no bounds checking on the destination buffer.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy
Signed-off-by: Sudeepgoud Patil <quic_sudeepgo@quicinc.com>
Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
---
drivers/rpmsg/qcom_glink_native.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 5ea096acc8581b1aff106f4c0e2f9aee9d56e25b..37b2255495d53270521466a05a5eb97eca98ec0e 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -501,7 +501,7 @@ static int qcom_glink_send_open_req(struct qcom_glink *glink,
req->cmd = cpu_to_le16(GLINK_CMD_OPEN);
req->param1 = cpu_to_le16(channel->lcid);
req->param2 = cpu_to_le32(name_len);
- strcpy(req->data, channel->name);
+ strscpy(req->data, channel->name, GLINK_NAME_SIZE);
trace_qcom_glink_cmd_open_tx(glink->label, channel->name,
channel->lcid, channel->rcid);
---
base-commit: d358e5254674b70f34c847715ca509e46eb81e6f
change-id: 20251203-rpmsg-glink-strcpy-replace-738ab624071f
Best regards,
--
Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rpmsg: glink: Replace strcpy() with strscpy()
2025-12-11 8:48 [PATCH] rpmsg: glink: Replace strcpy() with strscpy() Vishnu Santhosh
@ 2026-01-30 0:25 ` Chris Lew
2026-07-10 18:07 ` Bjorn Andersson
1 sibling, 0 replies; 3+ messages in thread
From: Chris Lew @ 2026-01-30 0:25 UTC (permalink / raw)
To: Vishnu Santhosh
Cc: Bjorn Andersson, Mathieu Poirier, deepak.singh, chris.lew,
linux-arm-msm, linux-remoteproc, linux-kernel, Sudeepgoud Patil
On Thu, Dec 11, 2025 at 02:18:34PM +0530, Vishnu Santhosh wrote:
> From: Sudeepgoud Patil <quic_sudeepgo@quicinc.com>
>
> Replace strcpy() with the safer strscpy() to address unsafe API
> usage warnings[1] from static analysis tools, as strcpy() performs
> no bounds checking on the destination buffer.
>
> [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy
>
> Signed-off-by: Sudeepgoud Patil <quic_sudeepgo@quicinc.com>
> Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
> ---
> drivers/rpmsg/qcom_glink_native.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Chris Lew <christopher.lew@oss.qualcomm.com>
> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
> index 5ea096acc8581b1aff106f4c0e2f9aee9d56e25b..37b2255495d53270521466a05a5eb97eca98ec0e 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
> @@ -501,7 +501,7 @@ static int qcom_glink_send_open_req(struct qcom_glink *glink,
> req->cmd = cpu_to_le16(GLINK_CMD_OPEN);
> req->param1 = cpu_to_le16(channel->lcid);
> req->param2 = cpu_to_le32(name_len);
> - strcpy(req->data, channel->name);
> + strscpy(req->data, channel->name, GLINK_NAME_SIZE);
>
> trace_qcom_glink_cmd_open_tx(glink->label, channel->name,
> channel->lcid, channel->rcid);
>
> ---
> base-commit: d358e5254674b70f34c847715ca509e46eb81e6f
> change-id: 20251203-rpmsg-glink-strcpy-replace-738ab624071f
>
> Best regards,
> --
> Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rpmsg: glink: Replace strcpy() with strscpy()
2025-12-11 8:48 [PATCH] rpmsg: glink: Replace strcpy() with strscpy() Vishnu Santhosh
2026-01-30 0:25 ` Chris Lew
@ 2026-07-10 18:07 ` Bjorn Andersson
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2026-07-10 18:07 UTC (permalink / raw)
To: Mathieu Poirier, deepak.singh, chris.lew, Vishnu Santhosh
Cc: linux-arm-msm, linux-remoteproc, linux-kernel, Sudeepgoud Patil
On Thu, 11 Dec 2025 14:18:34 +0530, Vishnu Santhosh wrote:
> Replace strcpy() with the safer strscpy() to address unsafe API
> usage warnings[1] from static analysis tools, as strcpy() performs
> no bounds checking on the destination buffer.
>
> [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy
>
>
> [...]
Applied, thanks!
[1/1] rpmsg: glink: Replace strcpy() with strscpy()
commit: ad6d7795388dbfc8a4c8980b49ad43648b1d6efe
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-10 18:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-11 8:48 [PATCH] rpmsg: glink: Replace strcpy() with strscpy() Vishnu Santhosh
2026-01-30 0:25 ` Chris Lew
2026-07-10 18:07 ` Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®