]> git.baikalelectronics.ru Git - kernel.git/commit
dpaa2-eth: prevent array underflow in update_cls_rule()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 8 May 2020 14:37:20 +0000 (17:37 +0300)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 May 2020 01:43:27 +0000 (18:43 -0700)
commit770308a22ce75fef5fe6d1c063ab17e71563e7a6
tree3a488f8d1fdcbc2eddfff874ef81ae5004980f01
parent8312930c26db3e3c65eeef67c84064029eccdc95
dpaa2-eth: prevent array underflow in update_cls_rule()

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: e91bc3ac7b4c ("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>
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c