netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Miguel García" <miguelgarciaroman8@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	willemdebruijn.kernel@gmail.com, jasowang@redhat.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, skhan@linuxfoundation.org
Subject: Re: [PATCH v2] net: tun: replace strcpy with strscpy for ifr_name
Date: Mon, 11 Aug 2025 18:05:46 -0700	[thread overview]
Message-ID: <20250811180546.1bd97b0c@kernel.org> (raw)
In-Reply-To: <20250811203329.854847-1-miguelgarciaroman8@gmail.com>

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

      reply	other threads:[~2025-08-12  1:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 11:22 [PATCH] net: tun: replace strcpy with strscpy for ifr_name Miguel García
2025-08-11 14:27 ` Willem de Bruijn
2025-08-11 20:33   ` [PATCH v2] " Miguel García
2025-08-12  1:05     ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250811180546.1bd97b0c@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguelgarciaroman8@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=skhan@linuxfoundation.org \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).