Re: [PATCH net v2] net: hns: fix ethtool_get_strings overflow in hns driver

2017-05-02 Thread David Miller
From: Timmy Li Date: Tue, 2 May 2017 10:46:52 +0800 > hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated > is not enough for ethtool_get_strings(), which will cause random memory > corruption. > > When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the > t

[PATCH net v2] net: hns: fix ethtool_get_strings overflow in hns driver

2017-05-01 Thread Timmy Li
hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed without this patch: [ 43.115200] Sl