]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ipv6: ip6_gre: replace strcpy with strscpy for tunnel name
authorMiguel García <miguelgarciaroman8@gmail.com>
Mon, 18 Aug 2025 22:02:03 +0000 (00:02 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 01:06:24 +0000 (18:06 -0700)
commit09bde6fdcd752b4512e7b554a3259e4f6b77c6d1
treedee8c3bad74af1f48d1de02d7732342298a111c8
parent9efd5152e32bb446752ead726a4621a50a95c11f
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: Miguel García <miguelgarciaroman8@gmail.com>
Link: https://patch.msgid.link/20250818220203.899338-1-miguelgarciaroman8@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/ip6_gre.c