[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180405.220419.649122823049258826.davem@davemloft.net>
Date: Thu, 05 Apr 2018 22:04:19 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: andrew@...n.ch
Cc: netdev@...r.kernel.org, f.fainelli@...il.com,
vivien.didelot@...oirfairelinux.com
Subject: Re: [PATCH net] net: dsa: Discard frames from unused ports
From: Andrew Lunn <andrew@...n.ch>
Date: Thu, 5 Apr 2018 01:56:44 +0200
> The Marvell switches under some conditions will pass a frame to the
> host with the port being the CPU port. Such frames are invalid, and
> should be dropped. Not dropping them can result in a crash when
> incrementing the receive statistics for an invalid port.
>
> Reported-by: Chris Healy <cphealy@...il.com>
> Fixes: 5f6b4e14cada ("net: dsa: User per-cpu 64-bit statistics")
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
...
> + slave_port = &ds->ports[port];
> +
> + if (slave_port->type != DSA_PORT_TYPE_USER)
> + return NULL;
Look like we need a Fixes: update and an adjustment to use unlikely()
here based upon Florian's feedback.
Powered by blists - more mailing lists