Huazhong Tan
323a2ac522
net: hns3: fix double free bug when setting ringparam
The system will panic when change the ringparam in HNS3 drivers:
[ 1459.627727] hns3 0000:bd:00.0 eth6: Changing Tx/Rx ring ds from 1024/1024 to 24/24
[ 1459.635766] hns3 0000:bd:00.0 eth6: link down
[ 1459.640788] BUG: Bad page state in process ethtool pfn:203f75c18
[ 1459.646940] page:ffff7ee4ffd70600 refcount:0 mapcount:0 mapping:ffff993fff40f400 index:0x0 compound_mapcount: 0
[ 1459.656987] flags: 0x9fffe00000010200(slab|head)
[ 1459.661591] raw: 9fffe00000010200 dead000000000100 dead000000000122 ffff993fff40f400
[ 1459.669302] raw: 0000000000000000 0000000080100010 00000000ffffffff 0000000000000000
[ 1459.677016] page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
[ 1459.683432] bad because of flags: 0x200(slab)
[ 1459.687775] Modules linked in: ib_ipoib ib_umad rpcrdma ib_iser libiscsi scsi_transport_iscsi hns_roce_hw_v2 crct10dif_ce hns3 ses hclge hnae3 hisi_hpre hisi_zip qm uacce ip_tables x_tables hisi_sas_v3_hw hisi_sas_main libsas scsi_transport_sas
[ 1459.709329] CPU: 14 PID: 17244 Comm: ethtool Tainted: G O 5.3.0-rc4-00415-gc86f057 #1
[ 1459.718419] Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V3.B040.01 07/26/2019
[ 1459.727248] Call trace:
[ 1459.729688] dump_backtrace+0x0/0x150
[ 1459.733335] show_stack+0x24/0x30
[ 1459.736639] dump_stack+0xa0/0xc4
[ 1459.739943] bad_page+0xf0/0x158
[ 1459.743157] free_pages_check_bad+0x84/0xa0
[ 1459.747322] __free_pages_ok+0x348/0x378
[ 1459.751228] page_frag_free+0x80/0x88
[ 1459.754877] skb_free_head+0x38/0x48
[ 1459.758436] skb_release_data+0x134/0x160
[ 1459.762427] skb_release_all+0x30/0x40
[ 1459.766158] consume_skb+0x38/0x108
[ 1459.769633] __dev_kfree_skb_any+0x58/0x68
[ 1459.773718] hns3_fini_ring+0x48/0x58 [hns3]
[ 1459.777970] hns3_set_ringparam+0x2a8/0x418 [hns3]
[ 1459.782741] dev_ethtool+0x5f4/0x2080
[ 1459.786390] dev_ioctl+0x190/0x3d8
[ 1459.789777] sock_do_ioctl+0xf8/0x220
[ 1459.793423] sock_ioctl+0x3bc/0x490
[ 1459.796896] do_vfs_ioctl+0xc4/0x868
[ 1459.800454] ksys_ioctl+0x8c/0xa0
[ 1459.803752] __arm64_sys_ioctl+0x28/0x38
[ 1459.807658] el0_svc_common.constprop.0+0xe0/0x1e0
[ 1459.812426] el0_svc_handler+0x34/0x90
[ 1459.816158] el0_svc+0x10/0x14
[ 1459.819220] Disabling lock debugging due to kernel taint
[ 1459.825182] ------------[ cut here ]------------
Since ndo_stop will reclaim the RX's skb allocated by the driver,
so the backed up ring parameter should not keep this info.
Fixes: a723fb8efe ("net: hns3: refine for set ring parameters")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-06 15:20:34 +02:00
..
2019-08-03 07:02:01 -07:00
2019-07-12 12:24:03 -07:00
2019-07-24 11:02:28 +02:00
2019-08-07 12:23:57 -06:00
2019-08-27 14:23:31 -07:00
2019-08-20 11:48:54 +02:00
2019-08-16 12:35:56 +02:00
2019-08-06 15:25:28 +03:00
2019-08-28 12:34:11 +02:00
2019-08-14 15:50:46 +02:00
2019-08-29 17:23:52 +02:00
2019-06-14 14:20:46 -06:00
2019-08-05 00:55:00 +03:00
2019-08-16 10:30:21 -07:00
2019-08-06 14:37:58 -07:00
2019-07-21 13:31:14 -07:00
2019-07-11 15:36:02 -07:00
2019-08-10 13:39:47 +02:00
2019-07-18 09:49:30 +02:00
2019-09-05 09:49:49 +02:00
2019-07-19 10:42:02 -07:00
2019-06-19 17:09:55 +02:00
2019-08-22 11:26:10 -07:00
2019-07-19 10:42:02 -07:00
2019-06-27 10:24:47 -07:00
2019-06-19 17:09:55 +02:00
2019-07-25 20:09:37 -05:00
2019-08-18 09:36:51 -07:00
2019-08-28 22:26:47 +02:00
2019-08-28 22:59:18 +02:00
2019-08-23 11:00:43 +02:00
2019-08-30 10:55:29 +10:00
2019-08-20 10:40:40 +02:00
2019-07-30 14:21:32 -07:00
2019-08-20 12:49:57 -04:00
2019-08-07 14:50:49 -07:00
2019-06-29 21:08:14 -07:00
2019-08-28 22:29:02 +02:00
2019-08-30 15:06:17 +02:00
2019-07-09 09:04:31 -07:00
2019-07-09 12:34:26 -07:00
2019-08-05 17:42:24 +01:00
2019-09-03 21:46:13 -07:00
2019-08-20 11:28:04 -04:00
2019-08-21 07:14:10 +09:00
2019-07-11 15:38:21 -07:00
2019-08-01 20:21:00 +02:00
2019-08-22 16:22:03 -07:00
2019-07-09 08:59:39 -07:00
2019-06-21 03:14:30 -06:00
2019-07-31 21:44:45 +10:00
2019-07-14 16:36:51 -07:00
2019-08-23 10:11:42 -04:00
2019-08-16 08:59:33 -07:00
2019-07-20 09:34:55 -07:00
2019-07-11 18:11:21 -07:00
2019-07-11 15:14:01 -07:00
2019-08-27 10:47:01 -07:00
2019-08-28 22:57:07 +02:00
2019-08-30 09:17:53 +02:00
2019-08-29 14:31:23 +02:00
2019-09-06 15:20:34 +02:00
2019-08-06 18:44:57 -07:00
2019-08-05 15:42:27 -04:00
2019-07-27 08:25:51 -07:00
2019-08-20 11:02:10 -06:00
2019-07-30 18:22:20 +02:00
2019-08-14 20:12:16 -06:00
2019-07-15 20:44:49 -07:00
2019-07-04 22:01:59 -04:00
2019-07-09 12:34:26 -07:00
2019-08-27 14:23:31 -07:00
2019-08-09 19:53:04 -05:00
2019-07-29 11:43:48 +01:00
2019-07-01 15:04:59 +02:00
2019-07-29 23:35:31 +02:00
2019-08-22 11:17:20 -07:00
2019-07-15 11:03:02 -03:00
2019-08-20 19:43:33 -05:00
2019-07-22 11:23:00 +02:00
2019-07-16 19:23:24 -07:00
2019-07-25 11:37:40 -07:00
2019-08-08 13:17:38 +02:00
2019-07-17 08:58:04 -07:00
2019-08-01 14:07:46 +01:00
2019-07-17 11:44:41 -07:00
2019-07-19 17:13:56 -07:00
2019-07-17 10:03:50 -07:00
2019-08-27 14:23:31 -07:00
2019-08-27 14:23:31 -07:00
2019-08-29 17:34:38 +02:00
2019-08-09 10:20:40 +05:30
2019-08-05 11:49:02 -07:00
2019-06-25 08:05:34 +03:00
2019-08-19 11:54:03 -07:00
2019-08-27 14:23:31 -07:00
2019-07-23 09:36:07 +02:00
2019-07-12 12:24:03 -07:00
2019-07-30 17:39:39 +02:00
2019-06-19 17:09:55 +02:00
2019-08-28 22:48:38 +02:00
2019-06-19 17:09:07 +02:00
2019-07-17 11:23:13 -07:00
2019-08-06 18:44:57 -07:00
2019-08-22 11:26:10 -07:00
2019-07-19 10:42:02 -07:00
2019-06-24 05:22:31 +02:00
2019-07-15 11:03:02 -03:00
2019-08-22 11:26:10 -07:00
2019-08-02 15:26:48 -07:00