[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250501012555.92688-1-rubenru09@aol.com>
Date: Thu, 1 May 2025 02:23:00 +0100
From: Ruben Wauters <rubenru09@....com>
To: "David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>
Cc: Ruben Wauters <rubenru09@....com>,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH net-next] ipv4: ip_tunnel: Replace strcpy use with strscpy
Use of strcpy is decpreated, replaces the use of strcpy with strscpy as
recommended.
I am aware there is an explicit bounds check above, however using
strscpy protects against buffer overflows in any future code, and there
is no good reason I can see to not use it.
Signed-off-by: Ruben Wauters <rubenru09@....com>
---
net/ipv4/ip_tunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 3913ec89ad20..9724bbbd0e0a 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -247,7 +247,7 @@ static struct net_device *__ip_tunnel_create(struct net *net,
} else {
if (strlen(ops->kind) > (IFNAMSIZ - 3))
goto failed;
- strcpy(name, ops->kind);
+ strscpy(name, ops->kind);
strcat(name, "%d");
}
--
2.48.1
Powered by blists - more mailing lists