syzbot


INFO: task hung in htable_put

Status: fixed on 2020/03/24 16:08
Reported-by: syzbot+b91b5a1d238240129a28@syzkaller.appspotmail.com
Fix commit: acbc5071f073 netfilter: xt_hashlimit: limit the max size of hashtable
First crash: 1779d, last: 1733d
Fix bisection: fixed by (bisect log) :
commit acbc5071f073bc368d7d4f63902adf536cf37772
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
upstream INFO: task hung in htable_put C done done 29 1738d 1791d 15/28 fixed on 2020/11/16 12:12
linux-4.19 INFO: task hung in htable_put (2) 1 1358d 1358d 0/1 auto-closed as invalid on 2021/07/01 18:58

Sample crash report:
Cannot find add_set index 0 as target
Cannot find add_set index 0 as target
Cannot find add_set index 0 as target
Cannot find add_set index 0 as target
Cannot find add_set index 0 as target
INFO: task syz-executor423:8097 blocked for more than 140 seconds.
      Not tainted 4.19.105-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor423 D27936  8097   8093 0x00000006
Call Trace:
 context_switch kernel/sched/core.c:2826 [inline]
 __schedule+0x866/0x1dc0 kernel/sched/core.c:3515
 schedule+0x92/0x1c0 kernel/sched/core.c:3559
 schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3617
 __mutex_lock_common kernel/locking/mutex.c:1002 [inline]
 __mutex_lock+0x726/0x1300 kernel/locking/mutex.c:1072
 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087
 htable_put+0x21/0x220 net/netfilter/xt_hashlimit.c:440
 hashlimit_mt_destroy+0x56/0x70 net/netfilter/xt_hashlimit.c:979
 cleanup_match+0xde/0x170 net/ipv6/netfilter/ip6_tables.c:481
 find_check_entry.isra.0+0x454/0x920 net/ipv4/netfilter/ip_tables.c:567
 translate_table+0xcb4/0x17d0 net/ipv4/netfilter/ip_tables.c:720
 do_replace net/ipv4/netfilter/ip_tables.c:1139 [inline]
 do_ipt_set_ctl+0x2ef/0x492 net/ipv4/netfilter/ip_tables.c:1675
 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
 nf_setsockopt+0x77/0xd0 net/netfilter/nf_sockopt.c:115
 ip_setsockopt net/ipv4/ip_sockglue.c:1258 [inline]
 ip_setsockopt+0xdf/0x100 net/ipv4/ip_sockglue.c:1238
 tcp_setsockopt net/ipv4/tcp.c:3082 [inline]
 tcp_setsockopt+0x8f/0xe0 net/ipv4/tcp.c:3076
 sock_common_setsockopt+0x94/0xd0 net/core/sock.c:3046
 __sys_setsockopt+0x17a/0x280 net/socket.c:1901
 __do_sys_setsockopt net/socket.c:1912 [inline]
 __se_sys_setsockopt net/socket.c:1909 [inline]
 __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1909
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x441e89
Code: 20 63 61 73 74 20 79 6f 75 72 20 76 6f 74 65 20 69 66 20 79 6f 75 20 77 61 6e 74 20 75 73 20 74 6f 20 6b 65 65 70 20 74 68 69 <73> 20 66 65 61 74 75 72 65 2e 00 00 00 00 00 20 41 6c 72 65 61 64
RSP: 002b:00007ffe851e4568 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000441e89
RDX: 0000000000000040 RSI: 0004000000000000 RDI: 0000000000000003
RBP: 00000000004a3310 R08: 00000000000003c8 R09: 00001f9d20080522
R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000402ca0
R13: 0000000000402d30 R14: 0000000000000000 R15: 0000000000000000

Showing all locks held in the system:
2 locks held by kworker/1:1/25:
1 lock held by khungtaskd/1079:
 #0: 000000001aa6fd8a (rcu_read_lock){....}, at: debug_show_all_locks+0x5f/0x27e kernel/locking/lockdep.c:4438
2 locks held by kworker/0:2/2726:
1 lock held by rsyslogd/7935:
 #0: 00000000f19007d5 (&f->f_pos_lock){+.+.}, at: __fdget_pos+0xee/0x110 fs/file.c:767
2 locks held by getty/8058:
 #0: 00000000ef694f63 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 0000000089b20072 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/8059:
 #0: 00000000a0a9671c (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 000000007f7b6a18 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/8060:
 #0: 00000000d96db53e (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 000000004f160753 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/8061:
 #0: 0000000045eb6cd9 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 00000000f7a87943 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/8062:
 #0: 000000000d93cde2 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 00000000f4970995 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/8063:
 #0: 0000000080095305 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 0000000054f3308b (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by getty/8064:
 #0: 00000000794bb476 (&tty->ldisc_sem){++++}, at: ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
 #1: 00000000c93b3127 (&ldata->atomic_read_lock){+.+.}, at: n_tty_read+0x232/0x1b70 drivers/tty/n_tty.c:2154
2 locks held by syz-executor423/8095:
1 lock held by syz-executor423/8096:
 #0: 0000000012a95480 (hashlimit_mutex){+.+.}, at: htable_put+0x21/0x220 net/netfilter/xt_hashlimit.c:440
1 lock held by syz-executor423/8097:
 #0: 0000000012a95480 (hashlimit_mutex){+.+.}, at: htable_put+0x21/0x220 net/netfilter/xt_hashlimit.c:440
1 lock held by syz-executor423/8098:
 #0: 0000000012a95480 (hashlimit_mutex){+.+.}, at: htable_put+0x21/0x220 net/netfilter/xt_hashlimit.c:440
1 lock held by syz-executor423/8099:
 #0: 0000000012a95480 (hashlimit_mutex){+.+.}, at: htable_put+0x21/0x220 net/netfilter/xt_hashlimit.c:440
1 lock held by syz-executor423/8100:
 #0: 0000000012a95480 (hashlimit_mutex){+.+.}, at: htable_put+0x21/0x220 net/netfilter/xt_hashlimit.c:440

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

NMI backtrace for cpu 1
CPU: 1 PID: 1079 Comm: khungtaskd Not tainted 4.19.105-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 nmi_cpu_backtrace.cold+0x63/0xa4 lib/nmi_backtrace.c:101
 nmi_trigger_cpumask_backtrace+0x1b0/0x1f8 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:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:203 [inline]
 watchdog+0x9df/0xee0 kernel/hung_task.c:287
 kthread+0x354/0x420 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 8095 Comm: syz-executor423 Not tainted 4.19.105-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__read_once_size include/linux/compiler.h:193 [inline]
RIP: 0010:debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
RIP: 0010:do_raw_spin_lock+0x0/0x250 kernel/locking/spinlock_debug.c:112
Code: fa 05 48 83 c4 10 5b 5d c3 48 89 75 e8 4c 89 4d f0 e8 b4 a4 4f 00 48 8b 75 e8 4c 8b 4d f0 eb b3 66 2e 0f 1f 84 00 00 00 00 00 <48> b8 00 00 00 00 00 fc ff df 55 48 89 e5 41 56 41 55 41 54 49 89
RSP: 0018:ffff8880855cf7c0 EFLAGS: 00000286
RAX: 1ffffffff11e4ad1 RBX: 0000000006000000 RCX: 00000000b8064264
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffffc90005ea2048
RBP: ffff8880855cf7d8 R08: 0000000000007d1a R09: 0000000000000001
R10: ffff88808dd7c8a8 R11: ffffffff8a798010 R12: ffffc90005ea2048
R13: dffffc0000000000 R14: ffffc90005ea2000 R15: 0000000000cdc7d0
FS:  0000000001c1f880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000006cd080 CR3: 000000009387b000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 spin_lock_bh include/linux/spinlock.h:334 [inline]
 htable_selective_cleanup+0xa6/0x330 net/netfilter/xt_hashlimit.c:376
 htable_destroy net/netfilter/xt_hashlimit.c:416 [inline]
 htable_put+0x176/0x220 net/netfilter/xt_hashlimit.c:443
 hashlimit_mt_destroy+0x56/0x70 net/netfilter/xt_hashlimit.c:979
 cleanup_match+0xde/0x170 net/ipv6/netfilter/ip6_tables.c:481
 find_check_entry.isra.0+0x454/0x920 net/ipv4/netfilter/ip_tables.c:567
 translate_table+0xcb4/0x17d0 net/ipv4/netfilter/ip_tables.c:720
 do_replace net/ipv4/netfilter/ip_tables.c:1139 [inline]
 do_ipt_set_ctl+0x2ef/0x492 net/ipv4/netfilter/ip_tables.c:1675
 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
 nf_setsockopt+0x77/0xd0 net/netfilter/nf_sockopt.c:115
 ip_setsockopt net/ipv4/ip_sockglue.c:1258 [inline]
 ip_setsockopt+0xdf/0x100 net/ipv4/ip_sockglue.c:1238
 tcp_setsockopt net/ipv4/tcp.c:3082 [inline]
 tcp_setsockopt+0x8f/0xe0 net/ipv4/tcp.c:3076
 sock_common_setsockopt+0x94/0xd0 net/core/sock.c:3046
 __sys_setsockopt+0x17a/0x280 net/socket.c:1901
 __do_sys_setsockopt net/socket.c:1912 [inline]
 __se_sys_setsockopt net/socket.c:1909 [inline]
 __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1909
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x441e89
Code: e8 2c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 8b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffe851e4568 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000441e89
RDX: 0000000000000040 RSI: 0004000000000000 RDI: 0000000000000003
RBP: 00000000004a3310 R08: 00000000000003c8 R09: 00001f9c20080522
R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000402ca0
R13: 0000000000402d30 R14: 0000000000000000 R15: 0000000000000000

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/02/23 10:29 linux-4.19.y 4fccc2503536 2c36e7a7 .config console log report syz C ci2-linux-4-19
2020/02/04 15:58 linux-4.19.y 32ee7492f104 93e5e335 .config console log report syz C ci2-linux-4-19
2020/02/13 03:39 linux-4.19.y 357668399cf7 84f4fc8a .config console log report ci2-linux-4-19
2020/02/08 19:47 linux-4.19.y b499cf4b3a90 06150bf1 .config console log report ci2-linux-4-19
2020/01/28 09:56 linux-4.19.y 88d6de67e390 56cd6c9b .config console log report ci2-linux-4-19
2020/01/24 13:11 linux-4.19.y d183c8e2647a 2e95ab33 .config console log report ci2-linux-4-19
2020/01/21 18:57 linux-4.19.y dc4ba5be1bab 8eda0b95 .config console log report ci2-linux-4-19
2020/01/08 14:03 linux-4.19.y 3d40d7117e35 ddc3e859 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.