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:   Mon, 10 Dec 2018 20:04:18 +0000
From:   <Tristram.Ha@...rochip.com>
To:     <marex@...x.de>, <f.fainelli@...il.com>
CC:     <vivien.didelot@...oirfairelinux.com>, <andrew@...n.ch>,
        <Woojung.Huh@...rochip.com>, <UNGLinuxDriver@...rochip.com>,
        <davem@...emloft.net>, <netdev@...r.kernel.org>
Subject: RE: [PATCH] net: dsa: ksz: Increase the tag alignment

> >>>> -	padlen = (skb->len >= ETH_ZLEN) ? 0 : ETH_ZLEN - skb->len;
> >>>> +	padlen = (skb->len >= VLAN_ETH_ZLEN) ? 0 : VLAN_ETH_ZLEN - skb-
> >>>>> len;
> > Oh so they add the internal VLAN at the end of the frame, not the
> > beginning? That is quite surprising but that would not be the one single
> > oddity found with CPSW I am afraid.. The way I would approach this is
> > with layering where the padding needs to occur:
> >
> > - within the tag driver you need to make sure there is enough room to
> > insert the KSZ tag
> >
> > - within the ethernet MAC driver (which comes last in the transmit
> > path), you need to make sure there is enough room to insert that trailer
> > VLAN tag to permit internal transmission
> 
> So you think this is a bug in the CPSW instead ?
> 

I think what causes this problem.  In the MAC controller driver cpsw.c
the buffer is always padded to CPSW_MIN_PACKET_SIZE.  Normally that
size is 60 bytes, but after Linux 4.14 kernel it was changed to VLAN_ETH_ZLEN.
The original size should work, but I do not know why it was changed.  It seems
there is a new function using the CPSW_RX_VLAN_ENCAP bit.

It is similar to what I experienced with the Atmel MAC driver.  The newer kernels
added some changes that introduced a bug and broke the tail tagging code.  I had
to submit a fix to the MAC driver to correct that.

I do not think this patch should apply generally, but I do not know how to fix the
MAC driver to work in all cases.

You can try temporarily to change CPSW_MIN_PACKET_SIZE back to 60.

It is only used to assign to min_packet_size.  It may be possible to use a different
size like 60 instead of 64 in the skb_padto function.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ