Commit e4c7981
net: ethernet: mtk_eth_soc: fix possible NULL pointer dereference in mtk_hwlro_get_fdir_all()
rule_locs is allocated in ethtool_get_rxnfc and the size is determined by
rule_cnt from user space. So rule_cnt needs to be check before using
rule_locs to avoid NULL pointer dereference.
Fixes: 7aab747 ("net: ethernet: mediatek: add ethtool functions to configure RX flows of HW LRO")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 51fe0a4 commit e4c7981
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2994 | 2994 | | |
2995 | 2995 | | |
2996 | 2996 | | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
2997 | 3000 | | |
2998 | 3001 | | |
2999 | 3002 | | |
| |||
0 commit comments