Thread (6 messages) 6 messages, 3 authors, 2018-02-16

Re: [PATCH v2] net: dsa: mv88e6xxx: hwtstamp: fix potential negative array index read

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-02-16 15:55:54
Also in: lkml

On Fri, Feb 16, 2018 at 07:48:46AM -0800, Richard Cochran wrote:
On Thu, Feb 15, 2018 at 12:31:39PM -0600, Gustavo A. R. Silva wrote:
quoted
_port_ is being used as index to array port_hwtstamp before verifying
it is a non-negative number and a valid index at line 209 and 258:

if (port < 0 || port >= mv88e6xxx_num_ports(chip))

Fix this by checking _port_ before using it as index to array
port_hwtstamp.
NAK.   Port is already known to be valid in the callers.
Then we should take out the check. It is probably this check which is
causing the false positives.

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help