BUG: unable to handle kernel NULL pointer dereference in mem16_serial_out

23 views
Skip to first unread message

syzbot

unread,
Dec 8, 2019, 6:15:10 PM12/8/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: a844dc4c Linux 4.14.158
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=143c0e41e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=c02bef505ffc02ff
dashboard link: https://syzkaller.appspot.com/bug?extid=4c7f1a69dfe24c6b3aeb
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1017f061e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=128c3196e00000

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

random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1575846716.880:36): avc: denied { map } for
pid=7037 comm="syz-executor408" path="/root/syz-executor408174009"
dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
BUG: unable to handle kernel NULL pointer dereference at 0000000000000003
IP: writew arch/x86/include/asm/io.h:66 [inline]
IP: mem16_serial_out+0x6c/0x90 drivers/tty/serial/8250/8250_port.c:414
PGD 907da067 P4D 907da067 PUD 79451067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
Modules linked in:
CPU: 0 PID: 7037 Comm: syz-executor408 Not tainted 4.14.158-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff88808ff56640 task.stack: ffff88809f5b8000
RIP: 0010:writew arch/x86/include/asm/io.h:66 [inline]
RIP: 0010:mem16_serial_out+0x6c/0x90 drivers/tty/serial/8250/8250_port.c:414
RSP: 0018:ffff88809f5bf988 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: 0000000000000003 RCX: 0000000000000000
RDX: 1ffffffff14911af RSI: 0000000000000003 RDI: ffffffff8a488d78
RBP: ffff88809f5bf9a0 R08: ffff88808ff56640 R09: ffff88808ff56f08
R10: 0000000000000000 R11: 0000000000000000 R12: 00000000000000bf
R13: ffffffff8a488d38 R14: 000000000000000a R15: ffffffff8a488d88
FS: 0000000000f20880(0000) GS:ffff8880aec00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000003 CR3: 0000000097a2e000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
serial_port_out include/linux/serial_core.h:265 [inline]
serial8250_do_startup+0x1120/0x1d80
drivers/tty/serial/8250/8250_port.c:2140
serial8250_startup+0x5c/0x80 drivers/tty/serial/8250/8250_port.c:2411
uart_port_startup drivers/tty/serial/serial_core.c:231 [inline]
uart_startup.part.0+0x2e9/0x720 drivers/tty/serial/serial_core.c:270
uart_startup drivers/tty/serial/serial_core.c:267 [inline]
uart_set_info drivers/tty/serial/serial_core.c:1010 [inline]
uart_set_info_user drivers/tty/serial/serial_core.c:1038 [inline]
uart_ioctl+0x12e9/0x2610 drivers/tty/serial/serial_core.c:1361
tty_ioctl+0x841/0x1320 drivers/tty/tty_io.c:2661
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:500 [inline]
do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x440219
RSP: 002b:00007fff7812b688 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440219
RDX: 0000000020000240 RSI: 000000000000541f RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8
R10: 0000000000401b30 R11: 0000000000000246 R12: 0000000000401aa0
R13: 0000000000401b30 R14: 0000000000000000 R15: 0000000000000000
Code: 0f b6 8d d1 00 00 00 49 8d 7d 40 48 b8 00 00 00 00 00 fc ff df 48 89
fa 48 c1 ea 03 d3 e3 80 3c 02 00 75 19 48 63 db 49 03 5d 40 <66> 44 89 23
5b 41 5c 41 5d 5d c3 e8 64 65 37 fe eb c2 e8 bd 65
RIP: writew arch/x86/include/asm/io.h:66 [inline] RSP: ffff88809f5bf988
RIP: mem16_serial_out+0x6c/0x90 drivers/tty/serial/8250/8250_port.c:414
RSP: ffff88809f5bf988
CR2: 0000000000000003
---[ end trace 771de5296e2986c9 ]---


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

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

syzbot

unread,
Dec 8, 2019, 6:44:10 PM12/8/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: fb683b5e Linux 4.19.88
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12a8442ee00000
kernel config: https://syzkaller.appspot.com/x/.config?x=aa0c39a6a0078b1c
dashboard link: https://syzkaller.appspot.com/bug?extid=7c69b16d09d4fd344155
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=119ffbf2e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16a20aeae00000

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

audit: type=1800 audit(1575848468.499:33): pid=7420 uid=0 auid=4294967295
ses=4294967295 subj=system_u:system_r:kernel_t:s0 op=collect_data
cause=failed(directio) comm="startpar" name="rc.local" dev="sda1" ino=2465
res=0
kauditd_printk_skb: 2 callbacks suppressed
audit: type=1400 audit(1575848478.009:36): avc: denied { map } for
pid=7608 comm="syz-executor102" path="/root/syz-executor102309499"
dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
BUG: unable to handle kernel NULL pointer dereference at 0000000000000003
PGD a9122067 P4D a9122067 PUD a8576067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 7608 Comm: syz-executor102 Not tainted 4.19.88-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:writew arch/x86/include/asm/io.h:66 [inline]
RIP: 0010:mem16_serial_out+0x6c/0x90 drivers/tty/serial/8250/8250_port.c:413
Code: b6 8d e1 00 00 00 49 8d 7d 40 48 b8 00 00 00 00 00 fc ff df 48 89 fa
48 c1 ea 03 d3 e3 80 3c 02 00 75 19 48 63 db 49 03 5d 40 <66> 44 89 23 5b
41 5c 41 5d 5d c3 e8 24 6c f1 fd eb c2 e8 7d 6c f1
RSP: 0018:ffff88808f0ef850 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: 0000000000000003 RCX: 0000000000000000
RDX: 1ffffffff16da3f7 RSI: ffffffff83b165a6 RDI: ffffffff8b6d1fb8
RBP: ffff88808f0ef868 R08: ffff888082762300 R09: ffffed101480a1d6
R10: ffffed101480a1d5 R11: ffff8880a4050eab R12: 00000000000000bf
R13: ffffffff8b6d1f78 R14: 000000000000000a R15: ffffffff8b6d1fc8
FS: 00000000023d5880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000003 CR3: 000000008b54f000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
serial_port_out include/linux/serial_core.h:273 [inline]
serial8250_do_startup+0x1366/0x1fe0
drivers/tty/serial/8250/8250_port.c:2136
serial8250_startup+0x62/0x80 drivers/tty/serial/8250/8250_port.c:2406
uart_port_startup drivers/tty/serial/serial_core.c:218 [inline]
uart_startup.part.0+0x491/0x980 drivers/tty/serial/serial_core.c:257
uart_startup drivers/tty/serial/serial_core.c:254 [inline]
uart_set_info drivers/tty/serial/serial_core.c:997 [inline]
uart_set_info_user drivers/tty/serial/serial_core.c:1025 [inline]
uart_ioctl+0x15ec/0x2a60 drivers/tty/serial/serial_core.c:1348
tty_ioctl+0x7f3/0x1510 drivers/tty/tty_io.c:2669
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688
ksys_ioctl+0xab/0xd0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440219
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 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffe9d6c5098 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440219
RDX: 0000000020000240 RSI: 000000000000541f RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8
R10: 0000000000401b30 R11: 0000000000000246 R12: 0000000000401aa0
R13: 0000000000401b30 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
CR2: 0000000000000003
---[ end trace cdd6b5a08a10a8ff ]---
RIP: 0010:writew arch/x86/include/asm/io.h:66 [inline]
RIP: 0010:mem16_serial_out+0x6c/0x90 drivers/tty/serial/8250/8250_port.c:413
Code: b6 8d e1 00 00 00 49 8d 7d 40 48 b8 00 00 00 00 00 fc ff df 48 89 fa
48 c1 ea 03 d3 e3 80 3c 02 00 75 19 48 63 db 49 03 5d 40 <66> 44 89 23 5b
41 5c 41 5d 5d c3 e8 24 6c f1 fd eb c2 e8 7d 6c f1
RSP: 0018:ffff88808f0ef850 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: 0000000000000003 RCX: 0000000000000000
RDX: 1ffffffff16da3f7 RSI: ffffffff83b165a6 RDI: ffffffff8b6d1fb8
RBP: ffff88808f0ef868 R08: ffff888082762300 R09: ffffed101480a1d6
R10: ffffed101480a1d5 R11: ffff8880a4050eab R12: 00000000000000bf
R13: ffffffff8b6d1f78 R14: 000000000000000a R15: ffffffff8b6d1fc8
FS: 00000000023d5880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000003 CR3: 000000008b54f000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


Reply all
Reply to author
Forward
0 new messages