summaryrefslogtreecommitdiff
path: root/rust/helpers/platform.c
diff options
context:
space:
mode:
authorMiguel García <miguelgarciaroman8@gmail.com>2025-08-12 10:22:44 +0200
committerJakub Kicinski <kuba@kernel.org>2025-08-13 17:20:51 -0700
commita57384110dc633856216fc254680923905391d67 (patch)
treeb3c2812e5a0a245ddb84b61262806b974d2cfa4e /rust/helpers/platform.c
parent5e88777a382480d0b1f7eafb6d0fb680ec7a40bb (diff)
tun: replace strcpy with strscpy for ifr_name
Replace the strcpy() calls that copy the device name into ifr->ifr_name with strscpy() to avoid potential overflows and guarantee NULL termination. Destination is ifr->ifr_name (size IFNAMSIZ). Tested in QEMU (BusyBox rootfs): - Created TUN devices via TUNSETIFF helper - Set addresses and brought links up - Verified long interface names are safely truncated (IFNAMSIZ-1) Signed-off-by: Miguel García <miguelgarciaroman8@gmail.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20250812082244.60240-1-miguelgarciaroman8@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'rust/helpers/platform.c')
0 files changed, 0 insertions, 0 deletions