Thread (4 messages) flat view 4 messages, 3 authors, 2025-08-12

Re: [PATCH v2] net: tun: replace strcpy with strscpy for ifr_name

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-08-12 01:05:47
Also in: lkml

On Mon, 11 Aug 2025 22:33:29 +0200 Miguel García wrote:
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)

v2:
- Dropped third argument from strscpy(), inferred from field size.
Please don't post new patches in reply to old ones. Please read:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
there are multiple other problems with your submissions.
Please fix and repost.
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help