mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
dpaa2-eth: prevent array underflow in update_cls_rule()
[ Upstream commit6d32a51198] The "location" is controlled by the user via the ethtool_set_rxnfc() function. This update_cls_rule() function checks for array overflows but it doesn't check if the value is negative. I have changed the type to unsigned to prevent array underflows. Fixes:afb90dbb5f("dpaa2-eth: Add ethtool support for flow classification") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
84916465b0
commit
d07987924a
@@ -590,7 +590,7 @@ static int num_rules(struct dpaa2_eth_priv *priv)
|
||||
|
||||
static int update_cls_rule(struct net_device *net_dev,
|
||||
struct ethtool_rx_flow_spec *new_fs,
|
||||
int location)
|
||||
unsigned int location)
|
||||
{
|
||||
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
|
||||
struct dpaa2_eth_cls_rule *rule;
|
||||
|
||||
Reference in New Issue
Block a user