syzbot


KASAN: slab-out-of-bounds Read in hrtimer_nanosleep

Status: auto-closed as invalid on 2022/06/22 20:59
Reported-by: syzbot+febd862f1eb9d56e0ff6@syzkaller.appspotmail.com
First crash: 794d, last: 794d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in hrtimer_nanosleep ext4 syz error 1 110d 177d 0/26 upstream: reported syz repro on 2023/11/01 05:36

Sample crash report:
device bond1677 entered promiscuous mode
==================================================================
BUG: KASAN: slab-out-of-bounds in lookup_object lib/debugobjects.c:156 [inline]
BUG: KASAN: slab-out-of-bounds in __debug_object_init+0x742/0x9b0 lib/debugobjects.c:385
Read of size 8 at addr ffff88801b290018 by task syz-executor.1/12879

CPU: 0 PID: 12879 Comm: syz-executor.1 Not tainted 4.19.211-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+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 lookup_object lib/debugobjects.c:156 [inline]
 __debug_object_init+0x742/0x9b0 lib/debugobjects.c:385
 hrtimer_init_on_stack kernel/time/hrtimer.c:435 [inline]
 hrtimer_nanosleep+0x15b/0x570 kernel/time/hrtimer.c:1807
 common_nsleep+0x23/0x30 kernel/time/posix-timers.c:1204
 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1231 [inline]
 __se_sys_clock_nanosleep+0x261/0x360 kernel/time/posix-timers.c:1209
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f1899f97d81
Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 aa e7 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 e3 e7 ff ff 48 8b 04 24 eb 97 66 2e 0f 1f
RSP: 002b:00007ffc532dbe40 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 00007f189a085f60 RCX: 00007f1899f97d81
RDX: 00007ffc532dbe80 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007f189a087960 R08: 0000000000000000 R09: 00000257db8066ff
R10: 0000000000000000 R11: 0000000000000293 R12: 000000000023b316
R13: 00007ffc532dbf90 R14: 00007ffc532dbfb0 R15: 0000000000000032

Allocated by task 18455:
 __do_kmalloc_node mm/slab.c:3689 [inline]
 __kmalloc_node+0x4c/0x70 mm/slab.c:3696
 kmalloc_node include/linux/slab.h:557 [inline]
 kvmalloc_node+0xb4/0xf0 mm/util.c:423
kasan: CONFIG_KASAN_INLINE enabled
 kvmalloc include/linux/mm.h:577 [inline]
 kvzalloc include/linux/mm.h:585 [inline]
 netif_alloc_netdev_queues net/core/dev.c:8594 [inline]
 alloc_netdev_mqs+0x69f/0xd50 net/core/dev.c:9197
kasan: GPF could be caused by NULL-ptr deref or user memory access
 rtnl_create_link+0x1d4/0xa40 net/core/rtnetlink.c:2869
general protection fault: 0000 [#1] PREEMPT SMP KASAN
 rtnl_newlink+0xf45/0x15c0 net/core/rtnetlink.c:3131
CPU: 1 PID: 13023 Comm: kworker/u4:8 Not tainted 4.19.211-syzkaller #0
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
RIP: 0010:__debug_check_no_obj_freed lib/debugobjects.c:777 [inline]
RIP: 0010:debug_check_no_obj_freed+0x1c9/0x490 lib/debugobjects.c:817
 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
Code: 48 b8 00 01 00 00 00 00 ad de 4d 89 60 08 4c 89 c7 49 89 00 e8 a8 d6 ff ff 09 c3 4d 85 f6 74 2c 4d 89 f0 4c 89 c0 48 c1 e8 03 <42> 80 3c 38 00 0f 84 23 ff ff ff 4c 89 c7 4c 89 44 24 38 e8 9f 16
 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
RSP: 0018:ffff8882109e7d10 EFLAGS: 00010002
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
RAX: 00000000056accc4 RBX: 0000000000000000 RCX: ffffffff814bdebb
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
RDX: 1ffffffff1a7b2f3 RSI: 0000000000000004 RDI: ffff88800010c520
 __sys_sendmsg net/socket.c:2265 [inline]
 __do_sys_sendmsg net/socket.c:2274 [inline]
 __se_sys_sendmsg net/socket.c:2272 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
RBP: 0000000000000001 R08: 000000002b566620 R09: ffff88800fb7e4b8
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
R10: ffffffff8d3d978b R11: 00000000eedc7660 R12: dead000000000200
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
R13: ffff888091962a00 R14: 000000002b566620 R15: dffffc0000000000

FS:  0000000000000000(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
Freed by task 0:
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
(stack is not available)
CR2: 000055555710a108 CR3: 00000002108cf000 CR4: 00000000003406e0

DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
The buggy address belongs to the object at ffff88801b290400
 which belongs to the cache kmalloc-8192 of size 8192
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
The buggy address is located 1000 bytes to the left of
 8192-byte region [ffff88801b290400, ffff88801b292400)
Call Trace:
The buggy address belongs to the page:
page:ffffea00006ca400 count:1 mapcount:0 mapping:ffff88813bff2080 index:0x0 compound_mapcount: 0
 kmem_cache_free+0xff/0x260 mm/slab.c:3764
flags: 0xfff00000008100(slab|head)
 free_fs_struct fs/fs_struct.c:91 [inline]
 exit_fs+0x120/0x170 fs/fs_struct.c:107
raw: 00fff00000008100 ffffea0000667b08 ffffea00006c8a08 ffff88813bff2080
 do_exit+0xbc1/0x2be0 kernel/exit.c:866
raw: 0000000000000000 ffff88801b290400 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 call_usermodehelper_exec_async+0x48d/0x6a0 kernel/umh.c:129
 ffff88801b28ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88801b28ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
>ffff88801b290000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
Modules linked in:
                            ^
---[ end trace ad4bfaaa8fa5e0d3 ]---
 ffff88801b290080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
RIP: 0010:__debug_check_no_obj_freed lib/debugobjects.c:777 [inline]
RIP: 0010:debug_check_no_obj_freed+0x1c9/0x490 lib/debugobjects.c:817
 ffff88801b290100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
Code: 48 b8 00 01 00 00 00 00 ad de 4d 89 60 08 4c 89 c7 49 89 00 e8 a8 d6 ff ff 09 c3 4d 85 f6 74 2c 4d 89 f0 4c 89 c0 48 c1 e8 03 <42> 80 3c 38 00 0f 84 23 ff ff ff 4c 89 c7 4c 89 44 24 38 e8 9f 16
==================================================================
RSP: 0018:ffff8882109e7d10 EFLAGS: 00010002
----------------
Code disassembly (best guess):
   0:	48 b8 00 01 00 00 00 	movabs $0xdead000000000100,%rax
   7:	00 ad de
   a:	4d 89 60 08          	mov    %r12,0x8(%r8)
   e:	4c 89 c7             	mov    %r8,%rdi
  11:	49 89 00             	mov    %rax,(%r8)
  14:	e8 a8 d6 ff ff       	callq  0xffffd6c1
  19:	09 c3                	or     %eax,%ebx
  1b:	4d 85 f6             	test   %r14,%r14
  1e:	74 2c                	je     0x4c
  20:	4d 89 f0             	mov    %r14,%r8
  23:	4c 89 c0             	mov    %r8,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1) <-- trapping instruction
  2f:	0f 84 23 ff ff ff    	je     0xffffff58
  35:	4c 89 c7             	mov    %r8,%rdi
  38:	4c 89 44 24 38       	mov    %r8,0x38(%rsp)
  3d:	e8                   	.byte 0xe8
  3e:	9f                   	lahf
  3f:	16                   	(bad)

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/02/22 20:58 linux-4.19.y 3f8a27f9e27b 6e821dbf .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in hrtimer_nanosleep
* Struck through repros no longer work on HEAD.