Davide Caratti
bb2f930d6d
net/sched: fix infinite loop in sch_fq_pie
this command hangs forever:
# tc qdisc add dev eth0 root fq_pie flows 65536
watchdog: BUG: soft lockup - CPU#1 stuck for 23s! [tc:1028]
[...]
CPU: 1 PID: 1028 Comm: tc Not tainted 5.7.0-rc6+ #167
RIP: 0010:fq_pie_init+0x60e/0x8b7 [sch_fq_pie]
Code: 4c 89 65 50 48 89 f8 48 c1 e8 03 42 80 3c 30 00 0f 85 2a 02 00 00 48 8d 7d 10 4c 89 65 58 48 89 f8 48 c1 e8 03 42 80 3c 30 00 <0f> 85 a7 01 00 00 48 8d 7d 18 48 c7 45 10 46 c3 23 00 48 89 f8 48
RSP: 0018:ffff888138d67468 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 1ffff9200018d2b2 RBX: ffff888139c1c400 RCX: ffffffffffffffff
RDX: 000000000000c5e8 RSI: ffffc900000e5000 RDI: ffffc90000c69590
RBP: ffffc90000c69580 R08: fffffbfff79a9699 R09: fffffbfff79a9699
R10: 0000000000000700 R11: fffffbfff79a9698 R12: ffffc90000c695d0
R13: 0000000000000000 R14: dffffc0000000000 R15: 000000002347c5e8
FS: 00007f01e1850e40(0000) GS:ffff88814c880000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000067c340 CR3: 000000013864c000 CR4: 0000000000340ee0
Call Trace:
qdisc_create+0x3fd/0xeb0
tc_modify_qdisc+0x3be/0x14a0
rtnetlink_rcv_msg+0x5f3/0x920
netlink_rcv_skb+0x121/0x350
netlink_unicast+0x439/0x630
netlink_sendmsg+0x714/0xbf0
sock_sendmsg+0xe2/0x110
____sys_sendmsg+0x5b4/0x890
___sys_sendmsg+0xe9/0x160
__sys_sendmsg+0xd3/0x170
do_syscall_64+0x9a/0x370
entry_SYSCALL_64_after_hwframe+0x44/0xa9
we can't accept 65536 as a valid number for 'nflows', because the loop on
'idx' in fq_pie_init() will never end. The extack message is correct, but
it doesn't say that 0 is not a valid number for 'flows': while at it, fix
this also. Add a tdc selftest to check correct validation of 'flows'.
CC: Ivan Vecera <ivecera@redhat.com>
Fixes: ec97ecf1ebe4 ("net: sched: add Flow Queue PIE packet scheduler")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Reviewed-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-05-27 11:11:18 -07:00
..
2020-03-30 11:06:49 -07:00
2020-03-30 13:45:04 -07:00
2019-10-30 18:07:51 -07:00
2019-11-26 15:42:43 -08:00
2020-03-25 18:58:11 -07:00
2020-01-19 16:02:15 +01:00
2019-10-30 18:07:51 -07:00
2020-01-17 10:58:15 +01:00
2019-10-30 18:07:51 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-03-25 12:24:33 -07:00
2019-12-04 17:11:25 -08:00
2019-11-05 14:03:11 -08:00
2020-03-26 19:20:37 -07:00
2019-11-26 15:42:43 -08:00
2020-02-17 14:17:02 -08:00
2019-11-05 18:20:55 -08:00
2020-03-26 19:20:37 -07:00
2019-10-30 18:07:51 -07:00
2019-11-26 15:42:43 -08:00
2019-11-26 15:42:43 -08:00
2020-05-06 20:13:10 -07:00
2020-01-27 10:51:43 +01:00
2020-01-27 10:51:43 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-03-30 11:06:49 -07:00
2020-01-27 10:51:43 +01:00
2020-03-30 11:06:49 -07:00
2020-03-16 01:59:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-02-01 12:25:06 -08:00
2020-04-03 16:00:08 -07:00
2020-01-27 10:51:43 +01:00
2019-05-21 11:28:45 +02:00
2019-05-30 11:26:32 -07:00
2019-06-19 17:09:55 +02:00
2020-02-29 21:27:02 -08:00
2019-11-06 16:14:48 -08:00
2020-02-29 21:27:02 -08:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-01-27 10:55:26 +01:00
2020-03-03 15:09:12 -08:00
2020-01-23 11:38:31 +01:00
2020-03-17 21:16:35 -07:00
2020-02-29 21:27:02 -08:00
2019-05-30 11:26:32 -07:00
2020-01-14 11:48:41 -08:00
2019-09-30 11:07:46 -07:00
2020-03-24 16:14:05 -07:00
2020-04-27 11:35:27 -07:00
2019-07-29 09:46:58 -07:00
2019-06-19 17:09:55 +02:00
2019-10-04 18:28:30 -07:00
2020-04-22 19:20:28 -07:00
2019-12-18 13:32:29 -08:00
2020-03-05 14:03:31 -08:00
2020-04-27 11:34:04 -07:00
2020-05-27 11:11:18 -07:00
2020-03-17 21:16:35 -07:00
2020-03-12 11:19:24 -07:00
2019-05-30 11:26:32 -07:00
2019-04-27 17:07:21 -04:00
2019-10-23 20:13:22 -07:00
2019-09-27 12:13:55 +02:00
2020-02-19 17:49:48 -08:00
2019-12-03 11:53:55 -08:00
2019-12-06 11:58:45 -08:00
2019-11-30 10:38:40 -08:00
2020-02-29 21:27:02 -08:00
2020-03-09 18:05:55 -07:00
2019-05-30 11:26:32 -07:00
2020-01-08 12:45:53 -08:00
2019-06-19 17:09:55 +02:00
2020-03-30 11:06:49 -07:00
2019-10-23 20:13:22 -07:00
2020-04-27 11:49:57 -07:00
2020-05-03 15:52:13 -07:00
2020-03-12 11:25:08 -07:00
2020-01-25 10:56:31 +01:00
2019-05-30 11:26:32 -07:00