Re: [PATCH RESEND net-next] net/ncsi: Refactor MAC, VLAN filters

From: David Miller
Date: Tue Apr 17 2018 - 13:51:24 EST


From: Samuel Mendoza-Jonas <sam@xxxxxxxxxxxxxxxx>
Date: Tue, 17 Apr 2018 14:23:23 +1000

> The NCSI driver defines a generic ncsi_channel_filter struct that can be
> used to store arbitrarily formatted filters, and several generic methods
> of accessing data stored in such a filter.
> However in both the driver and as defined in the NCSI specification
> there are only two actual filters: VLAN ID filters and MAC address
> filters. The splitting of the MAC filter into unicast, multicast, and
> mixed is also technically not necessary as these are stored in the same
> location in hardware.
>
> To save complexity, particularly in the set up and accessing of these
> generic filters, remove them in favour of two specific structs. These
> can be acted on directly and do not need several generic helper
> functions to use.
>
> This also fixes a memory error found by KASAN on ARM32 (which is not
> upstream yet), where response handlers accessing a filter's data field
> could write past allocated memory.
...
> Reported-by: Joel Stanley <joel@xxxxxxxxx>
> Signed-off-by: Samuel Mendoza-Jonas <sam@xxxxxxxxxxxxxxxx>

Applied to net-next, thank you.