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: <CAFJtzm1OCz-U36j5Lq4y2EiqPHZOHXVzwJMdSnJ6CnUjzXk9og@mail.gmail.com>
Date:   Fri, 10 Apr 2020 11:53:56 +0200
From:   Charles DAYMAND <charles.daymand@...irst.fr>
To:     Heiner Kallweit <hkallweit1@...il.com>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        Eric Dumazet <edumazet@...gle.com>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net] r8169: fix multicast tx issue with macvlan interface

Hello,

I just tested your patch, there is no improvement on the issue.
I still have layer2 malformed packets.
I also created a TCP server on my laptop with the hardware
periodically sending udp and tcp packets and these packets are also
layer2 malformed.
Please find below an example of the malformed packet :
Frame 3533: 110 bytes on wire (880 bits), 110 bytes captured (880
bits) on interface 0
Ethernet II, Src: b2:41:6f:04:c1:86 (b2:41:6f:04:c1:86), Dst:
IPv4mcast_09 (01:00:5e:00:00:09)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 2833
    000. .... .... .... = Priority: Best Effort (default) (0)
    ...0 .... .... .... = DEI: Ineligible
    .... 1011 0001 0001 = ID: 2833
    Length: 96
        [Expert Info (Error/Malformed): Length field value goes past
the end of the payload]
            [Length field value goes past the end of the payload]
            [Severity level: Error]
            [Group: Malformed]
Logical-Link Control
Data (88 bytes)


Le mer. 8 avr. 2020 à 00:40, Heiner Kallweit <hkallweit1@...il.com> a écrit :
>
> On 07.04.2020 08:22, Heiner Kallweit wrote:
> > On 07.04.2020 01:20, Eric Dumazet wrote:
> >>
> >>
> >> On 4/6/20 3:16 PM, Heiner Kallweit wrote:
> >>
> >>>
> >>> In a similar context Realtek made me aware of a hw issue if IP header
> >>> has the options field set. You mentioned problems with multicast packets,
> >>> and based on the following code the root cause may be related.
> >>>
> >>> br_ip4_multicast_alloc_query()
> >>> -> iph->ihl = 6;
> >>>
> >>> I'd appreciate if you could test (with HW tx checksumming enabled)
> >>> whether this experimental patch fixes the issue with invalid/lost
> >>> multicasts.
> >>>
> >>>
> >>> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> >>> index e40e8eaeb..dd251ddb8 100644
> >>> --- a/drivers/net/ethernet/realtek/r8169_main.c
> >>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> >>> @@ -4319,6 +4319,10 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
> >>>                 rtl_chip_supports_csum_v2(tp))
> >>>                     features &= ~NETIF_F_ALL_TSO;
> >>>     } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
> >>> +           if (ip_hdrlen(skb) > sizeof(struct iphdr)) {
> >>
> >> Packet could be non IPv4 at this point. (IPv6 for instance)
> >>
> > Right, I should have mentioned it:
> > This experimental patch is for IPv4 only. In a final version (if it indeed
> > fixes the issue) I had to extend the condition and check for IPv4.
> >
> >>> +                   pr_info("hk: iphdr has options field set\n");
> >>> +                   features &= ~NETIF_F_CSUM_MASK;
> >>> +           }
> >>>             if (skb->len < ETH_ZLEN) {
> >>>                     switch (tp->mac_version) {
> >>>                     case RTL_GIGA_MAC_VER_11:
> >>>
> >
>
> Here comes an updated version of the experimental patch that checks for IPv4.
> It's part of a bigger experimental patch here, therefore it's not fully
> optimized.
>
>
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index e40e8eaeb..69e35da6c 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -4307,6 +4307,23 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
>         return NETDEV_TX_BUSY;
>  }
>
> +static netdev_features_t rtl8168evl_features_check(struct sk_buff *skb,
> +                                                  netdev_features_t features)
> +{
> +       __be16 proto = vlan_get_protocol(skb);
> +
> +       if (skb->ip_summed == CHECKSUM_PARTIAL) {
> +               if (proto == htons(ETH_P_IP)) {
> +                       if (ip_hdrlen(skb) > sizeof(struct iphdr)) {
> +                               pr_info("hk: iphdr has options field set\n");
> +                               features &= ~NETIF_F_CSUM_MASK;
> +                       }
> +               }
> +       }
> +
> +       return features;
> +}
> +
>  static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
>                                                 struct net_device *dev,
>                                                 netdev_features_t features)
> @@ -4314,6 +4331,9 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
>         int transport_offset = skb_transport_offset(skb);
>         struct rtl8169_private *tp = netdev_priv(dev);
>
> +       if (tp->mac_version == RTL_GIGA_MAC_VER_34)
> +               features = rtl8168evl_features_check(skb, features);
> +
>         if (skb_is_gso(skb)) {
>                 if (transport_offset > GTTCPHO_MAX &&
>                     rtl_chip_supports_csum_v2(tp))
> --
> 2.26.0
>
>


-- 

Charles Daymand

Développeur infrastructure

26 rue de Berri 75008 Paris

Assistance dédiée responsable de site - 01 70 70 46 70
Assistance utilisateur - 01 70 70 46 26

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ