Re: [PATCH] net: dsa: sja1105: fix new_retagging table size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 06, 2022 at 05:08:17PM +0100, Greg KH wrote:
> > Should be applied on top of 5.10.157.
> > It is not relevant for newer LTS kernels.
> 
> Why not?
> 
> Please describe in HUGE detail why that is the case, what commit changed
> the tree to prevent this, and why only this one tree needs this specific
> change.  We almost never want to take patches that are not in Linus's
> tree so the justification to do so is a much much higher level.
> 
> And properly get the needed network maintainers ack as well.

Here I suppose that you would like the commit description to state that
VLAN retagging was a mechanism used by the sja1105 driver between kernels
5.9 and 5.15 solely to multiplex VLAN information with source port information
to the CPU. It was limited in that it could only multiplex up to 32 VLANs,
and it was replaced with the bridge TX forwarding offload feature once
that became available. As a result, kernels 5.15 and newer have all
support for VLAN retagging removed.

However, there is a bug in the delta commit procedure sja1105_build_vlan_table()
used by the VLAN retagging code, where the driver allocates less memory
than it needs. It intends to allocate a maximum sized (SJA1105_MAX_RETAGGING_COUNT = 32)
array of retagging table elements, but instead it allocates that number
of elements of a different size (the table->ops->unpacked_entry_size of
BLK_IDX_RETAGGING is sizeof(struct sja1105_retagging_entry) aka 56,
whereas the table->ops->unpacked_entry_size of BLK_IDX_VLAN_LOOKUP is
sizeof(struct sja1105_vlan_lookup_entry), aka 48).

32 elements of 48 bytes will only fit 27 elements of 56 bytes. So when
the VLAN Retagging table contains 28 elements or more, the last few will
be stored in memory that is out of the array that was pre-allocated.

This change fixes the typo that led to that.

Something like that?



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux