[syzbot] [efi?] BUG: soft lockup in sync_hw_clock

From: syzbot
Date: Sun Apr 21 2024 - 10:58:30 EST


Hello,

syzbot found the following issue on:

HEAD commit: b5d2afe8745b Merge branches 'for-next/kbuild', 'for-next/m..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=114b08e7180000
kernel config: https://syzkaller.appspot.com/x/.config?x=560f5db1d0b3f6d0
dashboard link: https://syzkaller.appspot.com/bug?extid=b3dc5d82ebb394dabe43
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17220cc3180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=125a17b3180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/50bff35e1638/disk-b5d2afe8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4eeaa73e7ed1/vmlinux-b5d2afe8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8e796b089aa9/Image-b5d2afe8.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b3dc5d82ebb394dabe43@xxxxxxxxxxxxxxxxxxxxxxxxx

watchdog: BUG: soft lockup - CPU#0 stuck for 27s! [kworker/u8:9:2072]
Modules linked in:
irq event stamp: 3823076
hardirqs last enabled at (3823075): [<ffff80008ae6ec90>] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:85 [inline]
hardirqs last enabled at (3823075): [<ffff80008ae6ec90>] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:95
hardirqs last disabled at (3823076): [<ffff80008ae6c87c>] __el1_irq arch/arm64/kernel/entry-common.c:533 [inline]
hardirqs last disabled at (3823076): [<ffff80008ae6c87c>] el1_interrupt+0x24/0x68 arch/arm64/kernel/entry-common.c:551
softirqs last enabled at (3823050): [<ffff8000800218e4>] softirq_handle_end kernel/softirq.c:400 [inline]
softirqs last enabled at (3823050): [<ffff8000800218e4>] __do_softirq+0xb10/0xd2c kernel/softirq.c:583
softirqs last disabled at (3823039): [<ffff80008002ad34>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81
CPU: 0 PID: 2072 Comm: kworker/u8:9 Not tainted 6.9.0-rc3-syzkaller-gb5d2afe8745b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: events_freezable_pwr_efficient sync_hw_clock (events_freezable_pwr_ef)
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : finish_lock_switch+0xc0/0x1e4 kernel/sched/core.c:5164
lr : raw_spin_rq_unlock_irq kernel/sched/sched.h:1397 [inline]
lr : finish_lock_switch+0xbc/0x1e4 kernel/sched/core.c:5163
sp : ffff80009c8c7290
x29: ffff80009c8c7290 x28: 1fffe000367bc6df x27: ffff80008ee81218
x26: ffff80008ee80664 x25: 1fffe000367bc6f1 x24: ffff80008ee80000
x23: dfff800000000000 x22: ffff0001b3de3788 x21: ffff0001b3de2c98
x20: 0000000000000000 x19: ffff0001b3de2c80 x18: 1fffe000367b9996
x17: ffff80008ee7d000 x16: ffff800080333fec x15: 0000000000000001
x14: 1fffe000367bc590 x13: 0000000000000000 x12: 0000000000000003
x11: 0000000000000001 x10: 0000000000000003 x9 : 0000000000000000
x8 : 00000000003a55e1 x7 : ffff8000802aabc8 x6 : 0000000000000000
x5 : 0000000000000001 x4 : 0000000000000001 x3 : 0000000000000000
x2 : 0000000000000006 x1 : ffff80008afdfb40 x0 : ffff800124ffb000
Call trace:
__daif_local_irq_enable arch/arm64/include/asm/irqflags.h:26 [inline]
arch_local_irq_enable arch/arm64/include/asm/irqflags.h:48 [inline]
raw_spin_rq_unlock_irq kernel/sched/sched.h:1397 [inline]
finish_lock_switch+0xc0/0x1e4 kernel/sched/core.c:5163
finish_task_switch+0x120/0x614 kernel/sched/core.c:5281
context_switch kernel/sched/core.c:5412 [inline]
__schedule+0x14c0/0x24ec kernel/sched/core.c:6746
__schedule_loop kernel/sched/core.c:6823 [inline]
schedule+0xbc/0x238 kernel/sched/core.c:6838
schedule_timeout+0xb8/0x348 kernel/time/timer.c:2558
do_wait_for_common+0x30c/0x468 kernel/sched/completion.c:95
__wait_for_common kernel/sched/completion.c:116 [inline]
wait_for_common kernel/sched/completion.c:127 [inline]
wait_for_completion+0x48/0x60 kernel/sched/completion.c:148
__efi_queue_work+0x124/0x1a8 drivers/firmware/efi/runtime-wrappers.c:337
virt_efi_set_time+0x74/0xb4 drivers/firmware/efi/runtime-wrappers.c:364
efi_set_time+0x208/0x430 drivers/rtc/rtc-efi.c:184
rtc_set_time+0x43c/0x888 drivers/rtc/interface.c:158
update_rtc kernel/time/ntp.c:597 [inline]
sync_hw_clock+0x2e8/0x480 kernel/time/ntp.c:656
process_one_work+0x7b8/0x15d4 kernel/workqueue.c:3254
process_scheduled_works kernel/workqueue.c:3335 [inline]
worker_thread+0x938/0xef4 kernel/workqueue.c:3416
kthread+0x288/0x310 kernel/kthread.c:388
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860


---
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 syzkaller@xxxxxxxxxxxxxxxx.

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

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup