Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2026 22:09:32 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,  dev-commits-src-main@FreeBSD.org, Weixie Cui <cuiweixie@gmail.com>
Subject:   Re: git: edb302bb49e0 - main - linuxkpi: Fix strlcpy size in linuxkpi_alloc_netdev()
Message-ID:  <5o7qr01-sq55-n5o7-1419-89r528s53n2p@mnoonqbm.arg>
In-Reply-To: <69e934f2.26c9d.7222fed6@gitrepo.freebsd.org>

index | next in thread | previous in thread | raw e-mail

On Wed, 22 Apr 2026, Pouria Mousavizadeh Tehrani wrote:

> The branch main has been updated by pouria:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=edb302bb49e00723030b84624f16217f18760564
>
> commit edb302bb49e00723030b84624f16217f18760564
> Author:     Weixie Cui <cuiweixie@gmail.com>
> AuthorDate: 2026-03-31 10:21:30 +0000
> Commit:     Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
> CommitDate: 2026-04-22 20:51:48 +0000
>
>    linuxkpi: Fix strlcpy size in linuxkpi_alloc_netdev()
>
>    `sizeof(*ndev->name)` is `sizeof(char)`, not IFNAMSIZ, so
>    the interface name was effectively limited to a single byte.
>    Use `sizeof(ndev->name)` for the `char name[IFNAMSIZ]` member.
>
>    Signed-off-by:  Weixie Cui <cuiweixie@gmail.com>
>    Reviewed by:    pouria
>    Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2111

Fixes:	d105895844848

Thanks!

> ---
> sys/compat/linuxkpi/common/src/linux_netdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sys/compat/linuxkpi/common/src/linux_netdev.c b/sys/compat/linuxkpi/common/src/linux_netdev.c
> index ce9153614104..11bbbfe6e279 100644
> --- a/sys/compat/linuxkpi/common/src/linux_netdev.c
> +++ b/sys/compat/linuxkpi/common/src/linux_netdev.c
> @@ -405,7 +405,7 @@ linuxkpi_alloc_netdev(size_t len, const char *name, uint32_t flags,
> 	/* Always first as it zeros! */
> 	linuxkpi_init_dummy_netdev(ndev);
>
> -	strlcpy(ndev->name, name, sizeof(*ndev->name));
> +	strlcpy(ndev->name, name, sizeof(ndev->name));
>
> 	/* This needs extending as we support more. */
>
>
>

-- 
Bjoern A. Zeeb                                                     r15:7


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5o7qr01-sq55-n5o7-1419-89r528s53n2p>