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: <CANn89i+yC1b_KRx0smi20FuQjcbUMnqMhwLmnW=feFNM0hcMfw@mail.gmail.com>
Date: Thu, 23 Oct 2025 23:45:09 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Yonglong Li <liyonglong@...natelecom.cn>
Cc: netdev@...r.kernel.org, davem@...emloft.net, dsahern@...nel.org, 
	pabeni@...hat.com, kuba@...nel.org, horms@...nel.org
Subject: Re: [PATH net 2/2] net: ipv6: use drop reasons in ip6_fragment

On Thu, Oct 23, 2025 at 11:23 PM Yonglong Li <liyonglong@...natelecom.cn> wrote:
>
> use drop reasons in ip6_output like ip_fragment/ip_do_fragment
>
> Signed-off-by: Yonglong Li <liyonglong@...natelecom.cn>
> ---
>  net/ipv6/ip6_output.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index f904739e..575c7d1 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -875,6 +875,7 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
>                  int (*output)(struct net *, struct sock *, struct sk_buff *))
>  {
>         struct sk_buff *frag;
> +       enum skb_drop_reason reason = SKB_DROP_REASON_FRAG_FAILED;

Reverse Christmas .... move this one line up, or move "struct sk_buff *frag;"

>         struct rt6_info *rt = dst_rt6_info(skb_dst(skb));
>         struct ipv6_pinfo *np = skb->sk && !dev_recursion_level() ?
>                                 inet6_sk(skb->sk) : NULL;
> @@ -995,7 +996,7 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
>                         return 0;
>                 }
>
> -               kfree_skb_list(iter.frag);
> +               kfree_skb_list_reason(iter.frag, reason);
>
>                 IP6_INC_STATS(net, ip6_dst_idev(&rt->dst),
>                               IPSTATS_MIB_FRAGFAILS);
> @@ -1050,12 +1051,13 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
>
>  fail_toobig:
>         icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
> +       reason = SKB_DROP_REASON_PKT_TOO_BIG;
>         err = -EMSGSIZE;
>
>  fail:
>         IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
>                       IPSTATS_MIB_FRAGFAILS);
> -       kfree_skb(skb);
> +       kfree_skb_reason(skb, reason);

Same remark as the IPv4 part.

>         return err;
>  }
>
> --
> 1.8.3.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ