lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 22 Jul 2022 08:44:43 -0700
From:   Dipanjan Das <mail.dipanjan.das@...il.com>
To:     mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, vschneid@...hat.com, brauner@...nel.org,
        linux-kernel@...r.kernel.org
Cc:     syzkaller@...glegroups.com, fleischermarius@...glemail.com,
        its.priyanka.bose@...il.com
Subject: INFO: task hung in __bread_gfp

Hi,

We would like to report the following bug which has been found by our
modified version of syzkaller.

======================================================
description: INFO: task hung in __bread_gfp
affected file: kernel/sched/core.c
kernel version: 5.19-rc6
kernel commit: 32346491ddf24599decca06190ebca03ff9de7f8
git tree: upstream
kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=cd73026ceaed1402
crash reproducer: attached
======================================================
Crash log:
======================================================
INFO: task syz-executor.1:16085 blocked for more than 143 seconds.
      Tainted: G           OE     5.19.0-rc6-g2eae0556bb9d #2
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.1  state:D stack:27656 pid:16085 ppid:  6715 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5146 [inline]
 __schedule+0xa76/0x5140 kernel/sched/core.c:6458
 schedule+0xd2/0x1f0 kernel/sched/core.c:6530
 io_schedule+0x17/0x70 kernel/sched/core.c:8645
 bit_wait_io+0x12/0xd0 kernel/sched/wait_bit.c:209
 __wait_on_bit+0x60/0x190 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0xd5/0x110 kernel/sched/wait_bit.c:64
 wait_on_bit_io include/linux/wait_bit.h:101 [inline]
 __wait_on_buffer fs/buffer.c:122 [inline]
 wait_on_buffer include/linux/buffer_head.h:355 [inline]
 __bread_slow fs/buffer.c:1178 [inline]
 __bread_gfp+0x2b8/0x370 fs/buffer.c:1381
 sb_bread include/linux/buffer_head.h:302 [inline]
 befs_fill_super+0x7f4/0x10d0 fs/befs/linuxvfs.c:856
 mount_bdev+0x34d/0x410 fs/super.c:1367
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1497
 do_new_mount fs/namespace.c:3040 [inline]
 path_mount+0x1228/0x1cb0 fs/namespace.c:3370
 do_mount+0xf3/0x110 fs/namespace.c:3383
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount fs/namespace.c:3568 [inline]
 __x64_sys_mount+0x18f/0x230 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f0ade28d4ed
RSP: 002b:00007f0adf332be8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f0ade3abf60 RCX: 00007f0ade28d4ed
RDX: 0000000020000000 RSI: 0000000020000040 RDI: 0000000020000140
RBP: 00007f0ade2f92e1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000010 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffd73a61ff R14: 00007f0ade3abf60 R15: 00007f0adf332d80
 </TASK>
INFO: task syz-executor.0:16102 blocked for more than 143 seconds.
      Tainted: G           OE     5.19.0-rc6-g2eae0556bb9d #2
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.0  state:D stack:28120 pid:16102 ppid:  6710 flags:0x00000004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5146 [inline]
 __schedule+0xa76/0x5140 kernel/sched/core.c:6458
 schedule+0xd2/0x1f0 kernel/sched/core.c:6530
 blk_mq_freeze_queue_wait+0x112/0x160 block/blk-mq.c:180
 nbd_add_socket+0x102/0x7c0 drivers/block/nbd.c:1122
 __nbd_ioctl drivers/block/nbd.c:1463 [inline]
 nbd_ioctl+0x392/0x970 drivers/block/nbd.c:1520
 blkdev_ioctl+0x36e/0x800 block/ioctl.c:614
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7fc55a08d4ed
RSP: 002b:00007fc558811be8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fc55a1abf60 RCX: 00007fc55a08d4ed
RDX: 0000000000000006 RSI: 000000000000ab00 RDI: 0000000000000005
RBP: 00007fc55a0f92e1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd96314b6f R14: 00007fc55a1abf60 R15: 00007fc558811d80
 </TASK>
INFO: task syz-executor.0:16105 blocked for more than 143 seconds.
      Tainted: G           OE     5.19.0-rc6-g2eae0556bb9d #2
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.0  state:D stack:28120 pid:16105 ppid:  6710 flags:0x00000004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5146 [inline]
 __schedule+0xa76/0x5140 kernel/sched/core.c:6458
 schedule+0xd2/0x1f0 kernel/sched/core.c:6530
 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6589
 __mutex_lock_common kernel/locking/mutex.c:679 [inline]
 __mutex_lock+0xfa9/0x1f50 kernel/locking/mutex.c:747
 nbd_ioctl+0x155/0x970 drivers/block/nbd.c:1513
 blkdev_ioctl+0x36e/0x800 block/ioctl.c:614
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7fc55a08d4ed
RSP: 002b:00007fc5587cfbe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fc55a1ac120 RCX: 00007fc55a08d4ed
RDX: ffffffffffffffff RSI: 000000000000ab00 RDI: 0000000000000008
RBP: 00007fc55a0f92e1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd96314b6f R14: 00007fc55a1ac120 R15: 00007fc5587cfd80
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/27:
 #0: ffffffff8bd83aa0 (rcu_read_lock){....}-{1:2}, at:
debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6491
1 lock held by in:imklog/6665:
 #0: ffff88810093e368 (&f->f_pos_lock){+.+.}-{3:3}, at:
__fdget_pos+0xe3/0x100 fs/file.c:1036
1 lock held by syz-executor.1/16085:
 #0: ffff88817ae360e0 (&type->s_umount_key#51/1){+.+.}-{3:3}, at:
alloc_super+0x1dd/0xa80 fs/super.c:228
1 lock held by syz-executor.0/16102:
 #0: ffff8881140ff998 (&nbd->config_lock){+.+.}-{3:3}, at:
nbd_ioctl+0x155/0x970 drivers/block/nbd.c:1513
1 lock held by syz-executor.0/16105:
 #0: ffff8881140ff998 (&nbd->config_lock){+.+.}-{3:3}, at:
nbd_ioctl+0x155/0x970 drivers/block/nbd.c:1513

=============================================

NMI backtrace for cpu 0
CPU: 0 PID: 27 Comm: khungtaskd Tainted: G           OE
5.19.0-rc6-g2eae0556bb9d #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x1a1/0x1e0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:212 [inline]
 watchdog+0xcc8/0x1010 kernel/hung_task.c:369
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 7802 Comm: systemd-journal Tainted: G           OE
5.19.0-rc6-g2eae0556bb9d #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:check_kcov_mode+0x2e/0x40 kernel/kcov.c:177
Code: 9e 87 7e 89 c2 81 e2 00 01 00 00 a9 00 01 ff 00 74 10 31 c0 85
d2 74 15 8b 96 a4 15 00 00 85 d2 74 0b 8b 86 80 15 00 00 39 f8 <0f> 94
c0 c3 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 31 c0 65 8b
RSP: 0018:ffffc9001c2c7928 EFLAGS: 00000293
RAX: 0000000000000000 RBX: ffffc9001c2c7cf0 RCX: ffff8881a7ddbb00
RDX: 0000000000000000 RSI: ffff8881a7ddbb00 RDI: 0000000000000002
RBP: 0000000000000001 R08: ffffffff81dd256c R09: 0000000000000000
R10: 0000000000000007 R11: 000000000008a07a R12: 000000000000000c
R13: ffff888117d73068 R14: ffff888117d70bc0 R15: dffffc0000000000
FS:  00007f1e3485e8c0(0000) GS:ffff8881f5f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1e2eb03000 CR3: 0000000134fca000 CR4: 0000000000150ee0
Call Trace:
 <TASK>
 __sanitizer_cov_trace_pc+0x1a/0x40 kernel/kcov.c:200
 __seqprop_spinlock_sequence include/linux/seqlock.h:275 [inline]
 __d_lookup_rcu+0x18c/0x740 fs/dcache.c:2345
 lookup_fast+0xe1/0x6d0 fs/namei.c:1624
 walk_component+0xcf/0x6a0 fs/namei.c:2010
 link_path_walk.part.0+0x787/0xeb0 fs/namei.c:2341
 link_path_walk fs/namei.c:2264 [inline]
 path_lookupat.isra.0+0x99/0x580 fs/namei.c:2492
 filename_lookup+0x1ca/0x410 fs/namei.c:2522
 user_path_at_empty+0x42/0x60 fs/namei.c:2895
 user_path_at include/linux/namei.h:57 [inline]
 do_faccessat+0x127/0x850 fs/open.c:446
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f1e332db9c7
Code: 83 c4 08 48 3d 01 f0 ff ff 73 01 c3 48 8b 0d c8 d4 2b 00 f7 d8
64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 b8 15 00 00 00 0f 05 <48> 3d
01 f0 ff ff 73 01 c3 48 8b 0d a1 d4 2b 00 f7 d8 64 89 01 48
RSP: 002b:00007fffb696cbc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000015
RAX: ffffffffffffffda RBX: 00007fffb696fae0 RCX: 00007f1e332db9c7
RDX: 00007f1e34360a00 RSI: 0000000000000000 RDI: 000055b8fd7d89a3
RBP: 00007fffb696cc00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000069 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fffb696fae0 R15: 00007fffb696d0f0
 </TASK>
----------------
Code disassembly (best guess):
   0: 9e                    sahf
   1: 87 7e 89              xchg   %edi,-0x77(%rsi)
   4: c2 81 e2              retq   $0xe281
   7: 00 01                add    %al,(%rcx)
   9: 00 00                add    %al,(%rax)
   b: a9 00 01 ff 00        test   $0xff0100,%eax
  10: 74 10                je     0x22
  12: 31 c0                xor    %eax,%eax
  14: 85 d2                test   %edx,%edx
  16: 74 15                je     0x2d
  18: 8b 96 a4 15 00 00    mov    0x15a4(%rsi),%edx
  1e: 85 d2                test   %edx,%edx
  20: 74 0b                je     0x2d
  22: 8b 86 80 15 00 00    mov    0x1580(%rsi),%eax
  28: 39 f8                cmp    %edi,%eax
* 2a: 0f 94 c0              sete   %al <-- trapping instruction
  2d: c3                    retq
  2e: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1)
  35: 00 00 00 00
  39: 0f 1f 00              nopl   (%rax)
  3c: 31 c0                xor    %eax,%eax
  3e: 65                    gs
  3f: 8b                    .byte 0x8b

-- 
Thanks and Regards,

Dipanjan

View attachment "repro.c" of type "text/x-csrc" (9406 bytes)

Download attachment "repro.syz" of type "application/octet-stream" (612 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ