Subject: BUG: corrupted list in neigh_mark_dead

From: syzbot <[email-masked]>
Date: Sun, 09 Dec 2018 21:41:05 -0800

Hello,

syzbot found the following crash on:

HEAD commit:    83af01ba1c2d Merge branch 'tc-testing-next'
git tree:       net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=14cea3f5400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=28ecefa8a6e10719
dashboard link: https://syzkaller.appspot.com/bug?extid=6cc2fd1d3bdd2e007363
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=141032db400000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=150bb3d5400000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: [email-masked]

list_del corruption. prev->next should be ffff8881b4412b70, but was  
ffff8881d5d58ff0
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:53!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 2770 Comm: kworker/0:2 Not tainted 4.20.0-rc4+ #333
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Workqueue: events_power_efficient neigh_periodic_work
RIP: 0010:__list_del_entry_valid.cold.1+0x48/0x4a lib/list_debug.c:51
Code: d6 60 88 e8 b2 fd d1 fd 0f 0b 48 89 de 48 c7 c7 40 d8 60 88 e8 a1 fd  
d1 fd 0f 0b 48 89 de 48 c7 c7 e0 d7 60 88 e8 90 fd d1 fd <0f> 0b 48 89 d9  
48 c7 c7 a0 d8 60 88 e8 7f fd d1 fd 0f 0b 48 89 f1
RSP: 0018:ffff8881cda97440 EFLAGS: 00010282
RAX: 0000000000000054 RBX: ffff8881b4412b70 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8165eae5 RDI: 0000000000000005
RBP: ffff8881cda97458 R08: ffff8881cdb4e400 R09: ffffed103b5c5020
R10: ffffed103b5c5020 R11: ffff8881dae28107 R12: ffff8881bb333930
R13: ffff8881d13d62b0 R14: ffff8881cda97560 R15: 1ffff11039b52e94
FS:  0000000000000000(0000) GS:ffff8881dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004155d0 CR3: 00000001c1769000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  __list_del_entry include/linux/list.h:117 [inline]
  list_del_init include/linux/list.h:159 [inline]
  neigh_mark_dead+0x13b/0x410 net/core/neighbour.c:125
  neigh_periodic_work+0x89a/0xc30 net/core/neighbour.c:905
  process_one_work+0xc90/0x1c40 kernel/workqueue.c:2153
  worker_thread+0x17f/0x1390 kernel/workqueue.c:2296
  kthread+0x35a/0x440 kernel/kthread.c:246
  ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
Modules linked in:
---[ end trace 4c84591405102c9f ]---
RIP: 0010:__list_del_entry_valid.cold.1+0x48/0x4a lib/list_debug.c:51
Code: d6 60 88 e8 b2 fd d1 fd 0f 0b 48 89 de 48 c7 c7 40 d8 60 88 e8 a1 fd  
d1 fd 0f 0b 48 89 de 48 c7 c7 e0 d7 60 88 e8 90 fd d1 fd <0f> 0b 48 89 d9  
48 c7 c7 a0 d8 60 88 e8 7f fd d1 fd 0f 0b 48 89 f1
RSP: 0018:ffff8881cda97440 EFLAGS: 00010282
RAX: 0000000000000054 RBX: ffff8881b4412b70 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8165eae5 RDI: 0000000000000005
RBP: ffff8881cda97458 R08: ffff8881cdb4e400 R09: ffffed103b5c5020
R10: ffffed103b5c5020 R11: ffff8881dae28107 R12: ffff8881bb333930
R13: ffff8881d13d62b0 R14: ffff8881cda97560 R15: 1ffff11039b52e94
FS:  0000000000000000(0000) GS:ffff8881dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004155d0 CR3: 00000001c1769000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at [email-masked].

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with  
syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches