]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cdx: Fix off-by-one error in cdx_rpmsg_probe()
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 6 Aug 2025 09:05:09 +0000 (11:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:45 +0000 (16:28 +0200)
commit20729b8259144d46692a565ee70b3d83f95f8fa2
tree315fb9b4fe8baa8d5a911d3ce9e4c77f0c50a633
parent4de009fc0a3a2aee088897dba9061e0216344dec
cdx: Fix off-by-one error in cdx_rpmsg_probe()

commit 300a0cfe9f375b2843bcb331bcfa7503475ef5dd upstream.

In cdx_rpmsg_probe(), strscpy() is incorrectly called with the length of
the source string (excluding the NUL terminator) rather than the size of
the destination buffer. This results in one character less being copied
from 'cdx_rpmsg_id_table[0].name' to 'chinfo.name'.

Use the destination buffer size instead to ensure the name is copied
correctly.

Cc: stable <stable@kernel.org>
Fixes: 2a226927d9b8 ("cdx: add rpmsg communication channel for CDX")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250806090512.121260-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cdx/controller/cdx_rpmsg.c