[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180216154846.7ge6seynwxjkopmp@localhost>
Date: Fri, 16 Feb 2018 07:48:46 -0800
From: Richard Cochran <richardcochran@...il.com>
To: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
Cc: Brandon Streiff <brandon.streiff@...com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
Florian Fainelli <f.fainelli@...il.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: dsa: mv88e6xxx: hwtstamp: fix potential negative
array index read
On Thu, Feb 15, 2018 at 12:31:39PM -0600, Gustavo A. R. Silva wrote:
> _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.
See:
*** net/dsa/slave.c: dsa_slave_ioctl[266]
*** net/dsa/slave.c: dsa_skb_tx_timestamp[416]
*** net/dsa/dsa.c: dsa_skb_defer_rx_timestamp[152]
> Addresses-Coverity-ID: 1465287 ("Negative array index read")
> Addresses-Coverity-ID: 1465291 ("Negative array index read")
Please check the code before posting. These false positives are
really annoying.
Thanks,
Richard
Powered by blists - more mailing lists