aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-03-30 12:59:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-03-30 12:59:00 -0700
commit4e6e422985514f7469a3597dd3f76629cddc3d00 (patch)
treedd2c007c8857d34cb4f30caf60b8a7aaf90b20f4
parent486291a0e6246364936df1ecd64c90affef4b9c5 (diff)
parentf37e76abd614b68987abc8e5c22d986013349771 (diff)
downloadipsec-4e6e422985514f7469a3597dd3f76629cddc3d00.tar.gz
Merge tag 'staging-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver fixes from Greg KH: "Here are two small staging driver fixes for the vc04_services driver that resolve reported problems: - strncpy fix for information leak - another information leak discovered by the previous strncpy fix Both of these have been in linux-next all this past week with no reported issues" * tag 'staging-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: vc04_services: fix information leak in create_component() staging: vc04_services: changen strncpy() to strscpy_pad()
-rw-r--r--drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
index 258aa0e37f5544..4c3684dd902ed4 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -937,8 +937,9 @@ static int create_component(struct vchiq_mmal_instance *instance,
/* build component create message */
m.h.type = MMAL_MSG_TYPE_COMPONENT_CREATE;
m.u.component_create.client_component = component->client_component;
- strncpy(m.u.component_create.name, name,
- sizeof(m.u.component_create.name));
+ strscpy_pad(m.u.component_create.name, name,
+ sizeof(m.u.component_create.name));
+ m.u.component_create.pid = 0;
ret = send_synchronous_mmal_msg(instance, &m,
sizeof(m.u.component_create),