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] [day] [month] [year] [list]
Message-ID: <CANn89iK0Hu6CZQ=76+z6p-TPY4bTmEQh9SAgLu-==zNB9RrWMQ@mail.gmail.com>
Date: Wed, 2 Jul 2025 08:26:28 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Oscar Maes <oscmaes92@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, dsahern@...nel.org, 
	kuba@...nel.org, pabeni@...hat.com, horms@...nel.org, stable@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: ipv4: fix incorrect MTU in broadcast routes

On Wed, Jul 2, 2025 at 7:15 AM Oscar Maes <oscmaes92@...il.com> wrote:
>
> Currently, __mkroute_output overrules the MTU value configured for
> broadcast routes.
>
> This buggy behaviour can be reproduced with:
>
> ip link set dev eth1 mtu 9000
> ip route del broadcast 192.168.0.255 dev eth1 proto kernel scope link src 192.168.0.2
> ip route add broadcast 192.168.0.255 dev eth1 proto kernel scope link src 192.168.0.2 mtu 1500
>
> The maximum packet size should be 1500, but it is actually 8000:
>
> ping -b 192.168.0.255 -s 8000

Looks sane to me, but could you add a test in tools/testing/selftests/net ?



>
> Fix __mkroute_output to allow MTU values to be configured for
> for broadcast routes (to support a mixed-MTU local-area-network).
>
> Signed-off-by: Oscar Maes <oscmaes92@...il.com>
> ---
>  net/ipv4/route.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index fccb05fb3..a2a3b6482 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2585,7 +2585,6 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
>         do_cache = true;
>         if (type == RTN_BROADCAST) {
>                 flags |= RTCF_BROADCAST | RTCF_LOCAL;
> -               fi = NULL;
>         } else if (type == RTN_MULTICAST) {
>                 flags |= RTCF_MULTICAST | RTCF_LOCAL;
>                 if (!ip_check_mc_rcu(in_dev, fl4->daddr, fl4->saddr,
> --
> 2.39.5
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ