[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <PA4P189MB14210AA95DCA3715AFA7F4A68BB59@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM>
Date: Thu, 23 Jun 2022 14:20:47 +0500
From: Saud Farooqui <farooqui_saud@...mail.com>
To: mathieu.poirier@...aro.org
Cc: bjorn.andersson@...aro.org, linux-remoteproc@...r.kernel.org,
linux-kernel@...r.kernel.org, lkp@...el.com,
Saud Farooqui <farooqui_saud@...mail.com>
Subject: [PATCH v1] rpmsg: strcpy is not safe, use strscpy_pad() instead
Replace strcpy() with strscpy_pad() for copying the rpmsg
device name in rpmsg_register_device_override().
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Saud Farooqui <farooqui_saud@...mail.com>
---
drivers/rpmsg/rpmsg_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 290c1f02da10..a4bad4b00414 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -604,7 +604,7 @@ int rpmsg_register_device_override(struct rpmsg_device *rpdev,
int ret;
if (driver_override)
- strcpy(rpdev->id.name, driver_override);
+ strscpy_pad(rpdev->id.name, driver_override, RPMSG_NAME_SIZE);
dev_set_name(dev, "%s.%s.%d.%d", dev_name(dev->parent),
rpdev->id.name, rpdev->src, rpdev->dst);
--
2.25.1
Powered by blists - more mailing lists