mbox series

[net-next,v2,0/6] replace deprecated strcpy with strscpy

Message ID 20240828123224.3697672-1-lihongbo22@huawei.com
Headers show
Series replace deprecated strcpy with strscpy | expand

Message

Hongbo Li Aug. 28, 2024, 12:32 p.m. UTC
The deprecated helper strcpy() performs no bounds checking on the
destination buffer. This could result in linear overflows beyond
the end of the buffer, leading to all kinds of misbehaviors.
The safe replacement is strscpy() [1].

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]

Hongbo Li (6):
  net: prefer strscpy over strcpy
  net/ipv6: replace deprecated strcpy with strscpy
  net/netrom: prefer strscpy over strcpy
  net/netfilter: replace deprecated strcpy with strscpy
  net/tipc: replace deprecated strcpy with strscpy
  net/ipv4: net: prefer strscpy over strcpy

 net/core/dev.c                  | 2 +-
 net/ipv4/ip_tunnel.c            | 2 +-
 net/ipv4/netfilter/arp_tables.c | 2 +-
 net/ipv4/netfilter/ip_tables.c  | 2 +-
 net/ipv6/ndisc.c                | 2 +-
 net/netfilter/xt_recent.c       | 2 +-
 net/netrom/nr_route.c           | 4 ++--
 net/tipc/bearer.c               | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

Comments

Jakub Kicinski Aug. 29, 2024, 7:36 p.m. UTC | #1
On Wed, 28 Aug 2024 20:32:18 +0800 Hongbo Li wrote:
> The deprecated helper strcpy() performs no bounds checking on the
> destination buffer. This could result in linear overflows beyond
> the end of the buffer, leading to all kinds of misbehaviors.
> The safe replacement is strscpy() [1].

What's you plan? Are you going to send 200 patches like this
just for networking?

$ git grep strcpy -- net/ drivers/net/ | wc -l
199

Please don't. I'll look thru this series but it feels like such
a waste of time.
patchwork-bot+netdevbpf@kernel.org Aug. 29, 2024, 7:50 p.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 28 Aug 2024 20:32:18 +0800 you wrote:
> The deprecated helper strcpy() performs no bounds checking on the
> destination buffer. This could result in linear overflows beyond
> the end of the buffer, leading to all kinds of misbehaviors.
> The safe replacement is strscpy() [1].
> 
> Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/6] net: prefer strscpy over strcpy
    https://git.kernel.org/netdev/net-next/c/68016b997222
  - [net-next,v2,2/6] net/ipv6: replace deprecated strcpy with strscpy
    https://git.kernel.org/netdev/net-next/c/b19f69a95830
  - [net-next,v2,3/6] net/netrom: prefer strscpy over strcpy
    https://git.kernel.org/netdev/net-next/c/597be7bd17c3
  - [net-next,v2,4/6] net/netfilter: replace deprecated strcpy with strscpy
    (no matching commit)
  - [net-next,v2,5/6] net/tipc: replace deprecated strcpy with strscpy
    https://git.kernel.org/netdev/net-next/c/af1052fd49cc
  - [net-next,v2,6/6] net/ipv4: net: prefer strscpy over strcpy
    https://git.kernel.org/netdev/net-next/c/82183b03de5f

You are awesome, thank you!