Timmy Li
7d7100094c
net: hns: fix ethtool_get_strings overflow in hns driver
[ Upstream commit 412b65d15a ]
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] Slab corruption (Not tainted): Acpi-ParseExt start=ffff801fb0b69030, len=80
[ 43.115206] Redzone: 0x9f911029d006462/0x5f78745f31657070.
[ 43.115208] Last user: [<5f7272655f746b70>](0x5f7272655f746b70)
[ 43.115214] 010: 70 70 65 31 5f 74 78 5f 70 6b 74 00 6b 6b 6b 6b ppe1_tx_pkt.kkkk
[ 43.115217] 030: 70 70 65 31 5f 74 78 5f 70 6b 74 5f 6f 6b 00 6b ppe1_tx_pkt_ok.k
[ 43.115218] Next obj: start=ffff801fb0b69098, len=80
[ 43.115220] Redzone: 0x706d655f6f666966/0x9f911029d74e35b.
[ 43.115229] Last user: [<ffff0000084b11b0>](acpi_os_release_object+0x28/0x38)
[ 43.115231] 000: 74 79 00 6b 6b 6b 6b 6b 70 70 65 31 5f 74 78 5f ty.kkkkkppe1_tx_
[ 43.115232] 010: 70 6b 74 5f 65 72 72 5f 63 73 75 6d 5f 66 61 69 pkt_err_csum_fai
Signed-off-by: Timmy Li <lixiaoping3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-24 10:58:46 +01:00
..
2018-03-24 10:58:45 +01:00
2018-02-28 10:17:23 +01:00
2018-02-16 20:09:42 +01:00
2017-12-16 10:33:55 +01:00
2018-01-31 12:06:08 +01:00
2018-03-24 10:58:44 +01:00
2018-02-16 20:09:46 +01:00
2018-01-10 09:27:09 +01:00
2018-03-24 10:58:45 +01:00
2018-03-24 10:58:41 +01:00
2017-10-27 10:23:17 +02:00
2018-03-24 10:58:41 +01:00
2017-12-25 14:22:15 +01:00
2018-02-25 11:03:55 +01:00
2018-02-22 15:44:58 +01:00
2018-03-22 09:23:22 +01:00
2018-02-16 20:09:47 +01:00
2017-11-21 09:21:18 +01:00
2017-12-20 10:04:56 +01:00
2018-02-25 11:03:50 +01:00
2018-03-24 10:58:45 +01:00
2018-03-22 09:23:27 +01:00
2018-03-24 10:58:42 +01:00
2018-02-25 11:03:46 +01:00
2018-03-22 09:23:22 +01:00
2018-03-22 09:23:25 +01:00
2018-03-24 10:58:41 +01:00
2018-02-25 11:03:51 +01:00
2018-03-24 10:58:44 +01:00
2018-03-24 10:58:43 +01:00
2018-03-24 10:58:45 +01:00
2018-03-24 10:58:42 +01:00
2018-03-22 09:23:31 +01:00
2018-02-25 11:03:51 +01:00
2018-03-11 16:19:45 +01:00
2018-03-24 10:58:45 +01:00
2018-03-24 10:58:41 +01:00
2017-12-16 10:33:51 +01:00
2018-02-25 11:03:45 +01:00
2018-03-24 10:58:44 +01:00
2018-03-22 09:23:24 +01:00
2018-03-24 10:58:45 +01:00
2018-03-22 09:23:28 +01:00
2018-03-24 10:58:46 +01:00
2018-03-22 09:23:23 +01:00
2017-11-30 08:37:23 +00:00
2018-02-16 20:09:47 +01:00
2018-03-22 09:23:21 +01:00
2018-01-02 20:33:20 +01:00
2018-03-22 09:23:19 +01:00
2018-03-22 09:23:26 +01:00
2018-01-23 19:50:16 +01:00
2018-02-25 11:03:39 +01:00
2018-03-24 10:58:40 +01:00
2018-03-24 10:58:45 +01:00
2018-03-24 10:58:40 +01:00
2018-03-22 09:23:27 +01:00
2018-03-24 10:58:40 +01:00
2018-03-24 10:58:40 +01:00
2018-03-11 16:19:47 +01:00
2018-03-24 10:58:43 +01:00
2018-03-24 10:58:41 +01:00
2018-02-25 11:03:44 +01:00
2018-03-24 10:58:44 +01:00
2018-03-24 10:58:45 +01:00
2018-02-25 11:03:44 +01:00
2018-03-18 11:17:53 +01:00
2018-03-22 09:23:32 +01:00
2018-02-16 20:09:38 +01:00
2018-03-24 10:58:46 +01:00
2018-02-25 11:03:42 +01:00
2018-03-18 11:17:50 +01:00
2018-03-03 10:19:45 +01:00
2018-02-25 11:03:38 +01:00