UBSAN: undefined-behaviour in dummy_hub_control

9 views
Skip to first unread message

syzbot

unread,
Sep 24, 2020, 6:18:30 PM9/24/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d09b8017 Linux 4.19.147
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=119de6c5900000
kernel config: https://syzkaller.appspot.com/x/.config?x=47cc70be3c316a0a
dashboard link: https://syzkaller.appspot.com/bug?extid=009185147d6c72e5d5a5
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+009185...@syzkaller.appspotmail.com

netlink: 'syz-executor.5': attribute type 27 has an invalid length.
================================================================================
UBSAN: Undefined behaviour in drivers/usb/gadget/udc/dummy_hcd.c:2302:33
shift exponent 16403 is too large for 32-bit type 'int'
CPU: 1 PID: 31836 Comm: syz-executor.3 Not tainted 4.19.147-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_shift_out_of_bounds.cold+0x1c4/0x250 lib/ubsan.c:422
dummy_hub_control.cold+0x1a/0xbf drivers/usb/gadget/udc/dummy_hcd.c:2302
rh_call_control drivers/usb/core/hcd.c:679 [inline]
rh_urb_enqueue drivers/usb/core/hcd.c:838 [inline]
usb_hcd_submit_urb+0xb7e/0x20d0 drivers/usb/core/hcd.c:1651
usb_submit_urb+0xba2/0x13b0 drivers/usb/core/urb.c:571
usb_start_wait_urb+0x108/0x2b0 drivers/usb/core/message.c:57
usb_internal_control_msg drivers/usb/core/message.c:101 [inline]
usb_control_msg+0x31c/0x4a0 drivers/usb/core/message.c:152
proc_control+0x360/0x6d0 drivers/usb/core/devio.c:1143
usbdev_do_ioctl+0x15fc/0x3580 drivers/usb/core/devio.c:2423
usbdev_ioctl+0x21/0x30 drivers/usb/core/devio.c:2580
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45e179
Code: 3d b2 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 0b b2 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fba09544c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 000000000001ab80 RCX: 000000000045e179
RDX: 0000000020000000 RSI: 00000000c0185500 RDI: 0000000000000003
RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007fff877f352f R14: 00007fba095459c0 R15: 000000000118cf4c
================================================================================
netlink: 'syz-executor.5': attribute type 27 has an invalid length.
netlink: 'syz-executor.5': attribute type 27 has an invalid length.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 'syz-executor.0': attribute type 27 has an invalid length.
netlink: 'syz-executor.0': attribute type 27 has an invalid length.
nla_parse: 24 callbacks suppressed
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.1'.
netlink: 'syz-executor.1': attribute type 27 has an invalid length.
netlink: 'syz-executor.1': attribute type 27 has an invalid length.
netlink: 'syz-executor.2': attribute type 27 has an invalid length.
netlink: 'syz-executor.2': attribute type 27 has an invalid length.
audit: type=1400 audit(1600985861.416:33): avc: denied { create } for pid=32593 comm="syz-executor.3" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=tcp_socket permissive=1
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=47 sclass=netlink_audit_socket pid=32598 comm=syz-executor.3
audit: type=1400 audit(1600985861.416:34): avc: denied { connect } for pid=32593 comm="syz-executor.3" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=tcp_socket permissive=1
netlink: 'syz-executor.4': attribute type 27 has an invalid length.
netlink: 'syz-executor.4': attribute type 27 has an invalid length.
audit: type=1400 audit(1600985861.416:35): avc: denied { name_connect } for pid=32593 comm="syz-executor.3" scontext=system_u:object_r:hugetlbfs_t:s0 tcontext=system_u:object_r:port_t:s0 tclass=tcp_socket permissive=1
audit: type=1400 audit(1600985861.416:36): avc: denied { create } for pid=32593 comm="syz-executor.3" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=socket permissive=1
audit: type=1400 audit(1600985861.416:37): avc: denied { create } for pid=32593 comm="syz-executor.3" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=netlink_audit_socket permissive=1
audit: type=1400 audit(1600985861.416:38): avc: denied { ioctl } for pid=32593 comm="syz-executor.3" path="socket:[114984]" dev="sockfs" ino=114984 ioctlcmd=0x8912 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=netlink_audit_socket permissive=1
audit: type=1400 audit(1600985861.416:39): avc: denied { create } for pid=32593 comm="syz-executor.3" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=netlink_generic_socket permissive=1
audit: type=1400 audit(1600985861.416:40): avc: denied { create } for pid=32593 comm="syz-executor.3" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=unix_stream_socket permissive=1
audit: type=1400 audit(1600985861.416:41): avc: denied { ioctl } for pid=32593 comm="syz-executor.3" path="socket:[114989]" dev="sockfs" ino=114989 ioctlcmd=0x89f2 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=unix_stream_socket permissive=1
audit: type=1400 audit(1600985861.416:42): avc: denied { write } for pid=32593 comm="syz-executor.3" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=netlink_generic_socket permissive=1
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check.
nla_parse: 40 callbacks suppressed
netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'.


---
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 24, 2020, 6:32:17 PM9/24/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: d09b8017 Linux 4.19.147
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11f6dc8d900000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=136f5973900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1304e0e5900000

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

audit: type=1400 audit(1600986584.944:8): avc: denied { execmem } for pid=6484 comm="syz-executor125" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=process permissive=1
================================================================================
UBSAN: Undefined behaviour in drivers/usb/gadget/udc/dummy_hcd.c:2302:33
shift exponent 16403 is too large for 32-bit type 'int'
CPU: 1 PID: 6484 Comm: syz-executor125 Not tainted 4.19.147-syzkaller #0
RIP: 0033:0x443f29
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 fb d7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffc739c8088 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002e0 RCX: 0000000000443f29
RDX: 0000000020000000 RSI: 00000000c0185500 RDI: 0000000000000003
RBP: 00000000006ce018 R08: 0000000000000000 R09: 00000000004002e0
R10: 000000000000000f R11: 0000000000000246 R12: 0000000000401bb0
R13: 0000000000401c40 R14: 0000000000000000 R15: 0000000000000000
================================================================================

Reply all
Reply to author
Forward
0 new messages