Kernel bug: WARNING: refcount bug in ax25_setsockopt
Subsystem: hams
Status: open

Crash report:
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: lib/refcount.c:25 at refcount_warn_saturate+0xf9/0x120 lib/refcount.c:25, CPU#2: syz.0.203/6346
Modules linked in:
CPU: 2 UID: 0 PID: 6346 Comm: syz.0.203 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:refcount_warn_saturate+0xf9/0x120 lib/refcount.c:25
Code: 5d e9 5b 25 12 fd e8 56 25 12 fd 48 8d 3d 5f 68 e5 0b 67 48 0f b9 3a 5b 5d e9 43 25 12 fd e8 3e 25 12 fd 48 8d 3d 57 68 e5 0b <67> 48 0f b9 3a 5b 5d e9 2b 25 12 fd 48 89 ef e8 63 fb 7b fd e9 35
RSP: 0018:ffffc900032afd30 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000002 RCX: ffffffff84acbe2c
RDX: ffff8880335724c0 RSI: ffffffff84acbec2 RDI: ffffffff90922720
RBP: ffff88803716d2c8 R08: 0000000000000005 R09: 0000000000000004
R10: 0000000000000002 R11: ffff888033572ff0 R12: ffff88803716d2c8
R13: ffff88803716d200 R14: 0000000000000009 R15: ffff88802cd2f000
FS:  0000555585deb500(0000) GS:ffff8880d6af6000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f82cfd156c0 CR3: 000000002bb47000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 __refcount_add include/linux/refcount.h:289 [inline]
 __refcount_inc include/linux/refcount.h:366 [inline]
 refcount_inc include/linux/refcount.h:383 [inline]
 ax25_dev_hold include/net/ax25.h:289 [inline]
 ax25_setsockopt+0x10b3/0x1220 net/ax25/af_ax25.c:705
 do_sock_setsockopt+0xf3/0x1d0 net/socket.c:2322
 __sys_setsockopt+0x1a0/0x230 net/socket.c:2347
 __do_sys_setsockopt net/socket.c:2353 [inline]
 __se_sys_setsockopt net/socket.c:2350 [inline]
 __x64_sys_setsockopt+0xbd/0x160 net/socket.c:2350
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f030358f7c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc92cce468 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007f03037e5fa0 RCX: 00007f030358f7c9
RDX: 0000000000000019 RSI: 0000000000000101 RDI: 0000000000000004
RBP: 00007f0303613f91 R08: 0000000000000010 R09: 0000000000000000
R10: 0000200000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f03037e5fa0 R14: 00007f03037e5fa0 R15: 0000000000000005
 </TASK>
----------------
Code disassembly (best guess):
   0:	5d                   	pop    %rbp
   1:	e9 5b 25 12 fd       	jmp    0xfd122561
   6:	e8 56 25 12 fd       	call   0xfd122561
   b:	48 8d 3d 5f 68 e5 0b 	lea    0xbe5685f(%rip),%rdi        # 0xbe56871
  12:	67 48 0f b9 3a       	ud1    (%edx),%rdi
  17:	5b                   	pop    %rbx
  18:	5d                   	pop    %rbp
  19:	e9 43 25 12 fd       	jmp    0xfd122561
  1e:	e8 3e 25 12 fd       	call   0xfd122561
  23:	48 8d 3d 57 68 e5 0b 	lea    0xbe56857(%rip),%rdi        # 0xbe56881
* 2a:	67 48 0f b9 3a       	ud1    (%edx),%rdi <-- trapping instruction
  2f:	5b                   	pop    %rbx
  30:	5d                   	pop    %rbp
  31:	e9 2b 25 12 fd       	jmp    0xfd122561
  36:	48 89 ef             	mov    %rbp,%rdi
  39:	e8 63 fb 7b fd       	call   0xfd7bfba1
  3e:	e9                   	.byte 0xe9
  3f:	35                   	.byte 0x35