syzbot


INFO: task hung in hashlimit_mt_check_common

Status: fixed on 2020/03/17 21:24
Reported-by: syzbot+689d5ef2070161747b68@syzkaller.appspotmail.com
Fix commit: a86265edeb33 netfilter: xt_hashlimit: limit the max size of hashtable
First crash: 1556d, last: 1504d
Fix bisection: fixed by (bisect log) :
commit a86265edeb3314f9c3270a5bf18b4e72ebc65beb
Author: Cong Wang <xiyou.wangcong@gmail.com>
Date: Mon Feb 3 04:30:53 2020 +0000

  netfilter: xt_hashlimit: limit the max size of hashtable

  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 INFO: task hung in hashlimit_mt_check_common C done 3 1506d 1521d 1/1 fixed on 2020/03/16 09:27
upstream INFO: task hung in hashlimit_mt_check_common C done 20 1500d 1539d 15/26 fixed on 2020/04/15 17:19

Sample crash report:
INFO: task syz-executor235:7693 blocked for more than 140 seconds.
      Not tainted 4.14.170-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor235 D28528  7693   7381 0x00000004
Call Trace:
 context_switch kernel/sched/core.c:2808 [inline]
 __schedule+0x7b8/0x1cd0 kernel/sched/core.c:3384
 schedule+0x92/0x1c0 kernel/sched/core.c:3428
 schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3486
 __mutex_lock_common kernel/locking/mutex.c:833 [inline]
 __mutex_lock+0x73c/0x1470 kernel/locking/mutex.c:893
 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
 hashlimit_mt_check_common.isra.0+0x2b8/0x11b0 net/netfilter/xt_hashlimit.c:896
 hashlimit_mt_check_v2+0x304/0x390 net/netfilter/xt_hashlimit.c:943
 xt_check_match+0x254/0x530 net/netfilter/x_tables.c:501
 check_match net/ipv4/netfilter/ip_tables.c:485 [inline]
 find_check_match net/ipv4/netfilter/ip_tables.c:501 [inline]
 find_check_entry.isra.0+0x2f9/0x920 net/ipv4/netfilter/ip_tables.c:551
 translate_table+0xb3f/0x15a0 net/ipv4/netfilter/ip_tables.c:737
 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline]
 do_ipt_set_ctl+0x268/0x3ee net/ipv4/netfilter/ip_tables.c:1674
 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
 nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115
 ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline]
 ip_setsockopt+0x9b/0xb0 net/ipv4/ip_sockglue.c:1240
 udp_setsockopt+0x4e/0x90 net/ipv4/udp.c:2451
 ipv6_setsockopt+0x9e/0x130 net/ipv6/ipv6_sockglue.c:920
 tcp_setsockopt net/ipv4/tcp.c:2820 [inline]
 tcp_setsockopt+0x84/0xd0 net/ipv4/tcp.c:2814
 sock_common_setsockopt+0x94/0xd0 net/core/sock.c:2968
 SYSC_setsockopt net/socket.c:1865 [inline]
 SyS_setsockopt+0x13c/0x210 net/socket.c:1844
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4412c9
RSP: 002b:00007ffc6fa745d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004412c9
RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000102ce1 R08: 0000000000000001 R09: 00000000004002c8
R10: 00000000200014c0 R11: 0000000000000246 R12: 0000000000402040
R13: 00000000004020d0 R14: 0000000000000000 R15: 0000000000000000
INFO: task syz-executor235:7694 blocked for more than 140 seconds.
      Not tainted 4.14.170-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor235 D28080  7694   7380 0x00000004
Call Trace:
 context_switch kernel/sched/core.c:2808 [inline]
 __schedule+0x7b8/0x1cd0 kernel/sched/core.c:3384
 schedule+0x92/0x1c0 kernel/sched/core.c:3428
 schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3486
 __mutex_lock_common kernel/locking/mutex.c:833 [inline]
 __mutex_lock+0x73c/0x1470 kernel/locking/mutex.c:893
 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
 hashlimit_mt_check_common.isra.0+0x2b8/0x11b0 net/netfilter/xt_hashlimit.c:896
 hashlimit_mt_check_v2+0x304/0x390 net/netfilter/xt_hashlimit.c:943
 xt_check_match+0x254/0x530 net/netfilter/x_tables.c:501
 check_match net/ipv4/netfilter/ip_tables.c:485 [inline]
 find_check_match net/ipv4/netfilter/ip_tables.c:501 [inline]
 find_check_entry.isra.0+0x2f9/0x920 net/ipv4/netfilter/ip_tables.c:551
 translate_table+0xb3f/0x15a0 net/ipv4/netfilter/ip_tables.c:737
 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline]
 do_ipt_set_ctl+0x268/0x3ee net/ipv4/netfilter/ip_tables.c:1674
 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
 nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115
 ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline]
 ip_setsockopt+0x9b/0xb0 net/ipv4/ip_sockglue.c:1240
 udp_setsockopt+0x4e/0x90 net/ipv4/udp.c:2451
 ipv6_setsockopt+0x9e/0x130 net/ipv6/ipv6_sockglue.c:920
 tcp_setsockopt net/ipv4/tcp.c:2820 [inline]
 tcp_setsockopt+0x84/0xd0 net/ipv4/tcp.c:2814
 sock_common_setsockopt+0x94/0xd0 net/core/sock.c:2968
 SYSC_setsockopt net/socket.c:1865 [inline]
 SyS_setsockopt+0x13c/0x210 net/socket.c:1844
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4412c9
RSP: 002b:00007ffc6fa745d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004412c9
RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000102ce4 R08: 0000000000000001 R09: 00000000004002c8
R10: 00000000200014c0 R11: 0000000000000246 R12: 0000000000402040
R13: 00000000004020d0 R14: 0000000000000000 R15: 0000000000000000
INFO: task syz-executor235:7695 blocked for more than 140 seconds.
      Not tainted 4.14.170-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor235 D28280  7695   7382 0x00000004
Call Trace:
 context_switch kernel/sched/core.c:2808 [inline]
 __schedule+0x7b8/0x1cd0 kernel/sched/core.c:3384
 schedule+0x92/0x1c0 kernel/sched/core.c:3428
 schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3486
 __mutex_lock_common kernel/locking/mutex.c:833 [inline]
 __mutex_lock+0x73c/0x1470 kernel/locking/mutex.c:893
 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
 hashlimit_mt_check_common.isra.0+0x2b8/0x11b0 net/netfilter/xt_hashlimit.c:896
 hashlimit_mt_check_v2+0x304/0x390 net/netfilter/xt_hashlimit.c:943
 xt_check_match+0x254/0x530 net/netfilter/x_tables.c:501
 check_match net/ipv4/netfilter/ip_tables.c:485 [inline]
 find_check_match net/ipv4/netfilter/ip_tables.c:501 [inline]
 find_check_entry.isra.0+0x2f9/0x920 net/ipv4/netfilter/ip_tables.c:551
 translate_table+0xb3f/0x15a0 net/ipv4/netfilter/ip_tables.c:737
 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline]
 do_ipt_set_ctl+0x268/0x3ee net/ipv4/netfilter/ip_tables.c:1674
 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
 nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115
 ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline]
 ip_setsockopt+0x9b/0xb0 net/ipv4/ip_sockglue.c:1240
 udp_setsockopt+0x4e/0x90 net/ipv4/udp.c:2451
 ipv6_setsockopt+0x9e/0x130 net/ipv6/ipv6_sockglue.c:920
 tcp_setsockopt net/ipv4/tcp.c:2820 [inline]
 tcp_setsockopt+0x84/0xd0 net/ipv4/tcp.c:2814
 sock_common_setsockopt+0x94/0xd0 net/core/sock.c:2968
 SYSC_setsockopt net/socket.c:1865 [inline]
 SyS_setsockopt+0x13c/0x210 net/socket.c:1844
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4412c9
RSP: 002b:00007ffc6fa745d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004412c9
RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000102cd9 R08: 0000000000000001 R09: 00000000004002c8
R10: 00000000200014c0 R11: 0000000000000246 R12: 0000000000402040
R13: 00000000004020d0 R14: 0000000000000000 R15: 0000000000000000

Showing all locks held in the system:
1 lock held by khungtaskd/1055:
 #0:  (tasklist_lock){.+.+}, at: [<ffffffff81488cf8>] debug_show_all_locks+0x7f/0x21f kernel/locking/lockdep.c:4544
2 locks held by getty/7354:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff866928d3>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff834c38d6>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7355:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff866928d3>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff834c38d6>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7356:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff866928d3>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff834c38d6>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7357:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff866928d3>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff834c38d6>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7358:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff866928d3>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff834c38d6>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7359:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff866928d3>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff834c38d6>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
2 locks held by getty/7360:
 #0:  (&tty->ldisc_sem){++++}, at: [<ffffffff866928d3>] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376
 #1:  (&ldata->atomic_read_lock){+.+.}, at: [<ffffffff834c38d6>] n_tty_read+0x1e6/0x17d0 drivers/tty/n_tty.c:2156
1 lock held by syz-executor235/7691:
 #0:  (hashlimit_mutex){+.+.}, at: [<ffffffff854ff888>] hashlimit_mt_check_common.isra.0+0x2b8/0x11b0 net/netfilter/xt_hashlimit.c:896
1 lock held by syz-executor235/7693:
 #0:  (hashlimit_mutex){+.+.}, at: [<ffffffff854ff888>] hashlimit_mt_check_common.isra.0+0x2b8/0x11b0 net/netfilter/xt_hashlimit.c:896
1 lock held by syz-executor235/7694:
 #0:  (hashlimit_mutex){+.+.}, at: [<ffffffff854ff888>] hashlimit_mt_check_common.isra.0+0x2b8/0x11b0 net/netfilter/xt_hashlimit.c:896
1 lock held by syz-executor235/7695:
 #0:  (hashlimit_mutex){+.+.}, at: [<ffffffff854ff888>] hashlimit_mt_check_common.isra.0+0x2b8/0x11b0 net/netfilter/xt_hashlimit.c:896
1 lock held by syz-executor235/7696:
 #0:  (hashlimit_mutex){+.+.}, at: [<ffffffff854ff888>] hashlimit_mt_check_common.isra.0+0x2b8/0x11b0 net/netfilter/xt_hashlimit.c:896

=============================================

NMI backtrace for cpu 1
CPU: 1 PID: 1055 Comm: khungtaskd Not tainted 4.14.170-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x142/0x197 lib/dump_stack.c:58
 nmi_cpu_backtrace.cold+0x57/0x94 lib/nmi_backtrace.c:101
 nmi_trigger_cpumask_backtrace+0x141/0x189 lib/nmi_backtrace.c:62
 arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
 trigger_all_cpu_backtrace include/linux/nmi.h:140 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:195 [inline]
 watchdog+0x5e7/0xb90 kernel/hung_task.c:274
 kthread+0x319/0x430 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 7692 Comm: syz-executor235 Not tainted 4.14.170-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
task: ffff8880a9846600 task.stack: ffff88801d0e0000
RIP: 0010:__lock_acquire+0x49b/0x4620 kernel/locking/lockdep.c:3432
RSP: 0018:ffff88801d0e75c0 EFLAGS: 00000046
RAX: 000000000000053f RBX: 0000000000040000 RCX: 0000000000000000
RDX: 1ffff11015308dd9 RSI: 1ffff11015308dd4 RDI: ffff8880a9846ecc
RBP: ffff88801d0e7770 R08: 0000000000000001 R09: 0000000000040000
R10: ffff8880a9846ea8 R11: ffff8880a9846600 R12: ffffc90005e20060
R13: 000000000000053f R14: 0000000000000001 R15: 0000000000000000
FS:  00000000012f3880(0000) GS:ffff8880aec00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200014c0 CR3: 000000007a487000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3994
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
 _raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:176
 spin_lock_bh include/linux/spinlock.h:322 [inline]
 htable_selective_cleanup+0x9c/0x300 net/netfilter/xt_hashlimit.c:376
 htable_destroy net/netfilter/xt_hashlimit.c:416 [inline]
 htable_put+0x164/0x210 net/netfilter/xt_hashlimit.c:443
 hashlimit_mt_destroy_v2+0x56/0x70 net/netfilter/xt_hashlimit.c:964
 cleanup_match+0xc2/0x140 net/ipv6/netfilter/ip6_tables.c:491
 find_check_entry.isra.0+0x3fe/0x920 net/ipv4/netfilter/ip_tables.c:577
 translate_table+0xb3f/0x15a0 net/ipv4/netfilter/ip_tables.c:737
 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline]
 do_ipt_set_ctl+0x268/0x3ee net/ipv4/netfilter/ip_tables.c:1674
 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
 nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115
 ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline]
 ip_setsockopt+0x9b/0xb0 net/ipv4/ip_sockglue.c:1240
 udp_setsockopt+0x4e/0x90 net/ipv4/udp.c:2451
 ipv6_setsockopt+0x9e/0x130 net/ipv6/ipv6_sockglue.c:920
 tcp_setsockopt net/ipv4/tcp.c:2820 [inline]
 tcp_setsockopt+0x84/0xd0 net/ipv4/tcp.c:2814
 sock_common_setsockopt+0x94/0xd0 net/core/sock.c:2968
 SYSC_setsockopt net/socket.c:1865 [inline]
 SyS_setsockopt+0x13c/0x210 net/socket.c:1844
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4412c9
RSP: 002b:00007ffc6fa745d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004412c9
RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000102cdd R08: 0000000000000001 R09: 00000000004002c8
R10: 00000000200014c0 R11: 0000000000000246 R12: 0000000000402040
R13: 00000000004020d0 R14: 0000000000000000 R15: 0000000000000000
Code: c1 e1 13 09 c3 41 8b 42 20 48 c1 ea 03 09 d9 44 89 c3 c1 e3 12 81 e3 00 00 04 00 09 d9 25 ff 1f 00 00 41 09 c9 8b 4d 20 c1 e1 14 <41> 09 c9 41 09 c1 48 b8 00 00 00 00 00 fc ff df 45 89 4a 20 0f 

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/02/14 21:12 linux-4.14.y e0f8b8a65a47 5d7b90f1 .config console log report syz C ci2-linux-4-14
2020/02/13 19:34 linux-4.14.y e0f8b8a65a47 e6247653 .config console log report syz C ci2-linux-4-14
2020/02/10 08:24 linux-4.14.y e0f8b8a65a47 35f5e45e .config console log report syz C ci2-linux-4-14
2020/02/01 09:19 linux-4.14.y 9fa690a2a016 0eb59c27 .config console log report syz C ci2-linux-4-14
2019/12/25 05:59 linux-4.14.y e1f7d50ae3a3 be5c2c81 .config console log report syz C ci2-linux-4-14
2020/01/24 08:11 linux-4.14.y 8bac50406cca 2e95ab33 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.