Commit 09bde6fd authored by Miguel García's avatar Miguel García Committed by Jakub Kicinski
Browse files

ipv6: ip6_gre: replace strcpy with strscpy for tunnel name



Replace the strcpy() call that copies the device name into
tunnel->parms.name with strscpy(), to avoid potential overflow
and guarantee NULL termination. This uses the two-argument
form of strscpy(), where the destination size is inferred
from the array type.

Destination is tunnel->parms.name (size IFNAMSIZ).

Tested in QEMU (Alpine rootfs):
 - Created IPv6 GRE tunnels over loopback
 - Assigned overlay IPv6 addresses
 - Verified bidirectional ping through the tunnel
 - Changed tunnel parameters at runtime (`ip -6 tunnel change`)

Signed-off-by: default avatarMiguel García <miguelgarciaroman8@gmail.com>
Link: https://patch.msgid.link/20250818220203.899338-1-miguelgarciaroman8@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 9efd5152
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment