]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: bcm_sf2: fix buffer overflow doing set_rxnfc
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 30 Apr 2019 10:44:19 +0000 (13:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Apr 2019 15:02:37 +0000 (11:02 -0400)
commit763c783e3b5803947a0c16ef984575da38ca5189
tree983664237abc90e605ef1ba16230d74132d8f6cd
parentae59deefda89d7a74e5779ea182a1db32ee9a009
net: dsa: bcm_sf2: fix buffer overflow doing set_rxnfc

The "fs->location" is a u32 that comes from the user in ethtool_set_rxnfc().
We can't pass unclamped values to test_bit() or it results in an out of
bounds access beyond the end of the bitmap.

Fixes: bbce6847c422 ("net: dsa: bcm_sf2: Add support for ethtool::rxnfc")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2_cfp.c