UBSAN: undefined-behaviour in arch_uprobe_analyze_insn

5 views
Skip to first unread message

syzbot

unread,
Sep 16, 2020, 9:47:24 PM9/16/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a87f9628 Linux 4.19.145
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15517b0d900000
kernel config: https://syzkaller.appspot.com/x/.config?x=9688ecb5b728ce13
dashboard link: https://syzkaller.appspot.com/bug?extid=a3f0727d419f82e6b9b7
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+a3f072...@syzkaller.appspotmail.com

================================================================================
UBSAN: Undefined behaviour in arch/x86/kernel/uprobes.c:276:56
index 4 is out of range for type 'insn_byte_t [4]'
CPU: 1 PID: 10401 Comm: syz-executor.5 Not tainted 4.19.145-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Enabling of bearer <udp:syz0> rejected, failed to enable media
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x22c/0x33e lib/dump_stack.c:118
ubsan_epilogue+0xe/0x3a lib/ubsan.c:161
__ubsan_handle_out_of_bounds.cold+0x63/0x6f lib/ubsan.c:383
is_prefix_bad arch/x86/kernel/uprobes.c:276 [inline]
uprobe_init_insn arch/x86/kernel/uprobes.c:299 [inline]
arch_uprobe_analyze_insn+0x9d8/0xaa0 arch/x86/kernel/uprobes.c:868
prepare_uprobe kernel/events/uprobes.c:611 [inline]
install_breakpoint kernel/events/uprobes.c:654 [inline]
uprobe_mmap+0x8c2/0xa70 kernel/events/uprobes.c:1096
mmap_region+0x552/0x1510 mm/mmap.c:1803
do_mmap+0x8e8/0x1080 mm/mmap.c:1530
do_mmap_pgoff include/linux/mm.h:2326 [inline]
vm_mmap_pgoff+0x197/0x200 mm/util.c:357
ksys_mmap_pgoff+0x2d1/0x660 mm/mmap.c:1580
do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45d5f9
Code: 5d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f36622f0c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000020f80 RCX: 000000000045d5f9
RDX: 0000000000000000 RSI: 0000000000003000 RDI: 0000000020007000
RBP: 000000000118cf98 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000412 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffd0b268def R14: 00007f36622f19c0 R15: 000000000118cf4c
================================================================================
Enabling of bearer <udp:syz0> rejected, failed to enable media
Enabling of bearer <udp:syz0> rejected, failed to enable media
netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'.
xt_CT: netfilter: NOTRACK target is deprecated, use CT instead or upgrade iptables
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
xt_CT: netfilter: NOTRACK target is deprecated, use CT instead or upgrade iptables
xt_CT: You must specify a L4 protocol and not use inversions on it
netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'.
xt_CT: You must specify a L4 protocol and not use inversions on it
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'.
FAT-fs (loop1): Unrecognized mount option "measure" or missing value
FAT-fs (loop1): Unrecognized mount option "measure" or missing value
FAT-fs (loop1): Unrecognized mount option "measure" or missing value
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
FAT-fs (loop1): Unrecognized mount option "measure" or missing value
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
netlink: 'syz-executor.4': attribute type 29 has an invalid length.
netlink: 'syz-executor.4': attribute type 29 has an invalid length.


---
This report 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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Sep 20, 2020, 12:49:15 PM9/20/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 015e94d0 Linux 4.19.146
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13cac91d900000
kernel config: https://syzkaller.appspot.com/x/.config?x=243dd74ad58a8a57
dashboard link: https://syzkaller.appspot.com/bug?extid=a3f0727d419f82e6b9b7
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14ee2c03900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12d231ab900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+a3f072...@syzkaller.appspotmail.com

audit: type=1400 audit(1600620429.898:8): avc: denied { execmem } for pid=6485 comm="syz-executor393" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=process permissive=1
================================================================================
UBSAN: Undefined behaviour in arch/x86/kernel/uprobes.c:276:56
index 4 is out of range for type 'insn_byte_t [4]'
CPU: 0 PID: 6485 Comm: syz-executor393 Not tainted 4.19.146-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+0x22c/0x33e lib/dump_stack.c:118
ubsan_epilogue+0xe/0x3a lib/ubsan.c:161
__ubsan_handle_out_of_bounds.cold+0x63/0x6f lib/ubsan.c:383
is_prefix_bad arch/x86/kernel/uprobes.c:276 [inline]
uprobe_init_insn arch/x86/kernel/uprobes.c:299 [inline]
arch_uprobe_analyze_insn+0x9d8/0xaa0 arch/x86/kernel/uprobes.c:868
prepare_uprobe kernel/events/uprobes.c:611 [inline]
install_breakpoint kernel/events/uprobes.c:654 [inline]
uprobe_mmap+0x8c2/0xa70 kernel/events/uprobes.c:1096
mmap_region+0x552/0x1510 mm/mmap.c:1803
do_mmap+0x8e8/0x1080 mm/mmap.c:1530
do_mmap_pgoff include/linux/mm.h:2326 [inline]
vm_mmap_pgoff+0x197/0x200 mm/util.c:357
ksys_mmap_pgoff+0x2d1/0x660 mm/mmap.c:1580
do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440379
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 7b 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffc9703b438 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440379
RDX: 0000000000000000 RSI: 0000000000003000 RDI: 0000000020007000
RBP: 00000000006ca018 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000412 R11: 0000000000000246 R12: 0000000000401b80

Reply all
Reply to author
Forward
0 new messages