lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKNGiLK-_LJu4tMriPMLeQs6ZWhEy6E-11dA1SEE68h2g@mail.gmail.com>
Date: Wed, 26 Feb 2025 15:43:59 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: "David S. Miller" <davem@...emloft.net>, David Ahern <dsahern@...nel.org>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v1 net-next 11/12] ipv4: fib: Move fib_valid_key_len() to rtm_to_fib_config().

On Tue, Feb 25, 2025 at 7:27 PM Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
>
> fib_valid_key_len() is called in the beginning of fib_table_insert()
> or fib_table_delete() to check if the prefix length is valid.
>
> fib_table_insert() and fib_table_delete() are called from 3 paths
>
>   - ip_rt_ioctl()
>   - inet_rtm_newroute() / inet_rtm_delroute()
>   - fib_magic()
>
> In the first ioctl() path, rtentry_to_fib_config() checks the prefix
> length with bad_mask().  Also, fib_magic() always passes the correct
> prefix: 32 or ifa->ifa_prefixlen, which is already validated.
>
> Let's move fib_valid_key_len() to the rtnetlink path, rtm_to_fib_config().
>
> While at it, 2 direct returns in rtm_to_fib_config() are changed to
> goto to match other places in the same function
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>

Reviewed-by: Eric Dumazet <edumazet@...gle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ