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]
Date:   Tue, 20 Nov 2018 10:18:17 -0800
From:   Eric Dumazet <edumazet@...gle.com>
To:     David Miller <davem@...emloft.net>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        netdev <netdev@...r.kernel.org>,
        Tom Herbert <tom@...bertland.com>,
        Saeed Mahameed <saeedm@...lanox.com>
Subject: Re: [Patch net] net: invert the check of detecting hardware RX
 checksum fault

On Tue, Nov 20, 2018 at 10:13 AM David Miller <davem@...emloft.net> wrote:
>
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Mon, 19 Nov 2018 17:47:33 -0800
>
> >
> >
> > On 11/19/2018 05:42 PM, Cong Wang wrote:
> >> On Fri, Nov 16, 2018 at 12:15 PM Cong Wang <xiyou.wangcong@...il.com> wrote:
> >>>
> >>> On Thu, Nov 15, 2018 at 8:52 PM Eric Dumazet <eric.dumazet@...il.com> wrote:
> >>>>
> >>>> You could use trafgen to cook such a frame and confirm the theory.
> >>>>
> >>>> Something like :
> >>>
> >>> I will try it.
> >>
> >> I just tried it, it doesn't make much difference, the warning only
> >> shows up once after I ran the trafgen script for many times,
> >> it could be triggered by other daemons running on the host too.
> >
> >
> > I guess we will need to dump the whole packet for debugging,
> > as suggest by Herbert :/
>
> Something like this?  Is it safe to linearize here?
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index f2bfd2eda7b2..3955939cc0cf 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3094,6 +3094,8 @@ EXPORT_SYMBOL(__skb_gso_segment);
>  void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
>  {
>         if (net_ratelimit()) {
> +               static unsigned long last_full_pkt_dump = ~0UL;
> +
>                 pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>");
>                 if (dev)
>                         pr_err("dev features: %pNF\n", &dev->features);
> @@ -3102,6 +3104,13 @@ void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
>                        skb_shinfo(skb)->gso_size, skb_shinfo(skb)->gso_type,
>                        skb_shinfo(skb)->nr_frags, skb->ip_summed, skb->csum,
>                        skb->csum_complete_sw, skb->csum_valid, skb->csum_level);
> +               if (jiffies - last_full_pkt_dump >= (HZ * 60 * 5) &&
> +                   !skb_linearize(skb)) {
> +                       last_full_pkt_dump = jiffies;
> +                       print_hex_dump(KERN_ERR, "skb data: ",
> +                                      DUMP_PREFIX_OFFSET, 32, 1,
> +                                      skb->data, skb->len, false);


I guess we should dump from skb->head instead, to show all headers.

Maybe dump the mac header offset as well, so that we can ignore the
padding bytes (NET_SKB_PAD) if needed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ