Eric Dumazet
0d32ef8cef
net: sched: fix panic in rate estimators
Doing the following commands on a non idle network device
panics the box instantly, because cpu_bstats gets overwritten
by stats.
tc qdisc add dev eth0 root <your_favorite_qdisc>
... some traffic (one packet is enough) ...
tc qdisc replace dev eth0 root est 1sec 4sec <your_favorite_qdisc>
[ 325.355596] BUG: unable to handle kernel paging request at ffff8841dc5a074c
[ 325.362609] IP: [<ffffffff81541c9e>] __gnet_stats_copy_basic+0x3e/0x90
[ 325.369158] PGD 1fa7067 PUD 0
[ 325.372254] Oops: 0000 [#1] SMP
[ 325.375514] Modules linked in: ...
[ 325.398346] CPU: 13 PID: 14313 Comm: tc Not tainted 3.19.0-smp-DEV #1163
[ 325.412042] task: ffff8800793ab5d0 ti: ffff881ff2fa4000 task.ti: ffff881ff2fa4000
[ 325.419518] RIP: 0010:[<ffffffff81541c9e>] [<ffffffff81541c9e>] __gnet_stats_copy_basic+0x3e/0x90
[ 325.428506] RSP: 0018:ffff881ff2fa7928 EFLAGS: 00010286
[ 325.433824] RAX: 000000000000000c RBX: ffff881ff2fa796c RCX: 000000000000000c
[ 325.440988] RDX: ffff8841dc5a0744 RSI: 0000000000000060 RDI: 0000000000000060
[ 325.448120] RBP: ffff881ff2fa7948 R08: ffffffff81cd4f80 R09: 0000000000000000
[ 325.455268] R10: ffff883ff223e400 R11: 0000000000000000 R12: 000000015cba0744
[ 325.462405] R13: ffffffff81cd4f80 R14: ffff883ff223e460 R15: ffff883feea0722c
[ 325.469536] FS: 00007f2ee30fa700(0000) GS:ffff88407fa20000(0000) knlGS:0000000000000000
[ 325.477630] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 325.483380] CR2: ffff8841dc5a074c CR3: 0000003feeae9000 CR4: 00000000001407e0
[ 325.490510] Stack:
[ 325.492524] ffff883feea0722c ffff883fef719dc0 ffff883feea0722c ffff883ff223e4a0
[ 325.499990] ffff881ff2fa79a8 ffffffff815424ee ffff883ff223e49c 000000015cba0744
[ 325.507460] 00000000f2fa7978 0000000000000000 ffff881ff2fa79a8 ffff883ff223e4a0
[ 325.514956] Call Trace:
[ 325.517412] [<ffffffff815424ee>] gen_new_estimator+0x8e/0x230
[ 325.523250] [<ffffffff815427aa>] gen_replace_estimator+0x4a/0x60
[ 325.529349] [<ffffffff815718ab>] tc_modify_qdisc+0x52b/0x590
[ 325.535117] [<ffffffff8155edd0>] rtnetlink_rcv_msg+0xa0/0x240
[ 325.540963] [<ffffffff8155ed30>] ? __rtnl_unlock+0x20/0x20
[ 325.546532] [<ffffffff8157f811>] netlink_rcv_skb+0xb1/0xc0
[ 325.552145] [<ffffffff8155b355>] rtnetlink_rcv+0x25/0x40
[ 325.557558] [<ffffffff8157f0d8>] netlink_unicast+0x168/0x220
[ 325.563317] [<ffffffff8157f47c>] netlink_sendmsg+0x2ec/0x3e0
Lets play safe and not use an union : percpu 'pointers' are mostly read
anyway, and we have typically few qdiscs per host.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Fixes: 22e0f8b932 ("net: sched: make bstats per cpu and estimator RCU safe")
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-31 17:49:37 -08:00
..
2014-11-06 14:59:19 -05:00
2014-12-10 13:17:23 -05:00
2013-09-23 16:29:41 -04:00
2014-12-10 15:33:16 -05:00
2013-04-08 17:16:57 -04:00
2014-12-11 14:27:06 -08:00
2014-11-13 11:25:03 +01:00
2014-12-02 22:48:13 +01:00
2012-06-17 16:29:38 -07:00
2014-11-24 05:16:40 -05:00
2014-11-24 16:12:03 -05:00
2014-10-27 15:51:16 +01:00
2014-02-12 19:23:32 -05:00
2014-09-23 12:09:27 -04:00
2014-10-25 08:07:30 +02:00
2013-07-31 17:50:01 -07:00
2013-08-10 01:16:44 -07:00
2014-11-24 05:16:42 -05:00
2014-09-18 10:54:36 +02:00
2013-12-28 17:02:46 -05:00
2013-07-31 17:50:02 -07:00
2014-11-10 13:27:49 -05:00
2014-11-10 13:27:49 -05:00
2014-11-10 13:27:49 -05:00
2014-11-10 13:27:49 -05:00
2014-01-13 17:39:11 +01:00
2014-11-26 20:56:42 +01:00
2014-11-17 09:49:17 +01:00
2014-11-26 12:25:43 -05:00
2013-12-10 17:56:54 -05:00
2014-02-08 10:36:58 -05:00
2014-08-22 19:57:23 -07:00
2014-11-19 16:23:49 -05:00
2014-02-09 17:32:50 -08:00
2013-12-06 12:37:56 -05:00
2014-07-17 16:02:29 -07:00
2013-12-10 21:50:00 -05:00
2013-09-20 14:49:32 -04:00
2013-09-20 14:49:32 -04:00
2013-09-20 14:49:32 -04:00
2014-02-09 17:32:49 -08:00
2014-02-09 17:32:49 -08:00
2014-10-30 14:54:11 -04:00
2013-01-09 23:59:53 -08:00
2014-09-08 09:51:29 +09:00
2014-09-16 10:08:49 +02:00
2013-11-07 19:28:58 -05:00
2014-02-04 20:19:51 -08:00
2013-09-20 14:49:33 -04:00
2013-03-26 12:32:13 -04:00
2014-09-05 17:47:02 -07:00
2014-04-16 15:05:11 -04:00
2014-02-12 07:02:11 +01:00
2014-11-12 15:01:35 -05:00
2013-09-20 14:49:33 -04:00
2014-09-30 01:02:26 -04:00
2015-01-16 17:04:25 -05:00
2014-10-07 00:10:49 -04:00
2014-06-04 22:46:38 -07:00
2013-01-27 22:46:33 -05:00
2014-11-05 16:30:03 -05:00
2013-09-20 14:49:33 -04:00
2014-02-06 09:34:58 +01:00
2014-11-05 21:53:04 +01:00
2014-10-14 13:15:15 -04:00
2014-04-15 12:58:34 -04:00
2014-11-05 16:59:04 -05:00
2014-11-26 15:45:04 -05:00
2014-09-22 16:27:10 -04:00
2014-05-07 15:30:52 -04:00
2014-09-08 09:51:29 +09:00
2014-05-14 16:07:23 -04:00
2014-06-27 15:53:35 -07:00
2014-07-01 23:46:21 -07:00
2014-09-08 16:42:42 -07:00
2014-08-24 18:09:23 -07:00
2014-10-07 00:02:30 -04:00
2014-05-24 00:32:30 -04:00
2014-11-06 14:19:19 -05:00
2014-12-08 21:14:32 -05:00
2014-11-12 15:01:35 -05:00
2014-10-02 18:30:58 +02:00
2015-01-26 17:28:27 -08:00
2014-10-30 20:01:18 -04:00
2014-11-24 04:28:49 -05:00
2013-09-21 14:01:39 -04:00
2013-09-21 14:01:38 -04:00
2014-10-14 02:18:27 +02:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-12-10 15:21:24 -05:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-01-01 22:22:43 -05:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-12-10 15:21:24 -05:00
2013-09-21 14:01:38 -04:00
2014-01-03 20:56:48 -05:00
2015-01-05 10:33:46 +01:00
2014-11-13 04:51:58 +01:00
2013-12-06 12:37:56 -05:00
2014-09-22 16:23:15 -04:00
2014-11-05 23:52:33 -08:00
2013-10-01 17:06:14 -04:00
2013-09-21 14:01:39 -04:00
2014-12-26 17:07:08 -05:00
2014-12-04 14:31:00 -05:00
2013-09-21 14:01:39 -04:00
2014-08-07 20:55:21 -04:00
2014-10-28 17:07:29 -04:00
2014-02-08 10:36:58 -05:00
2013-09-21 14:01:39 -04:00
2014-11-09 19:50:28 +01:00
2013-09-21 14:01:39 -04:00
2014-11-18 15:28:28 -05:00
2014-10-06 18:02:32 -04:00
2014-10-06 00:55:10 -04:00
2014-05-23 16:28:53 -04:00
2013-09-23 01:51:08 -04:00
2013-09-23 01:51:08 -04:00
2013-09-23 01:51:08 -04:00
2014-01-21 23:17:20 -08:00
2014-11-28 14:33:41 +01:00
2013-10-10 00:08:07 -04:00
2013-09-23 01:51:08 -04:00
2014-03-24 12:45:01 -04:00
2014-07-15 16:13:07 -07:00
2015-01-31 17:49:37 -08:00
2013-09-23 01:51:09 -04:00
2014-06-02 11:00:41 -07:00
2014-10-15 07:48:18 +02:00
2014-12-13 13:33:26 -08:00
2013-12-19 18:51:20 -05:00
2013-09-23 01:51:09 -04:00
2014-12-02 20:01:22 -08:00
2013-10-21 18:43:02 -04:00
2015-01-28 22:18:37 -08:00
2012-06-09 14:56:12 -07:00
2014-01-19 19:53:18 -08:00
2014-05-22 14:57:15 -04:00
2014-11-10 15:09:45 -05:00
2014-10-01 21:35:51 -04:00
2014-12-09 16:29:03 -05:00
2013-07-27 22:14:06 -07:00
2014-12-26 17:20:56 -05:00
2013-09-23 16:29:40 -04:00
2014-09-05 17:35:28 -07:00
2013-09-23 16:29:41 -04:00
2014-09-02 13:37:56 +02:00