From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f77.google.com (mail-ot1-f77.google.com [209.85.210.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18D0D38837E for ; Fri, 22 May 2026 05:20:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.77 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779427242; cv=none; b=RKPOrQzXke+AkUMBTaYVz6EyXqWVeWmTmPV9QU9vI6PvRD683KFdJaDf/wJJfsK0oTaxi6SF8mejhNKGRWF0ATgD3TRyRITl64fw392nWV7CW+ddzGkNYKp8KWdU+yIu6OlvwLRMnG7rfoTnFF8lmwY/GlakumBK3lCWMDaAbQQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779427242; c=relaxed/simple; bh=IKOhpsdEXheT5+gj+ST9mSwwEvpsMA3rvTprpUW7jeg=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=QIpXjzpfDQ05NrW74pur4J7EpeKW8gFJp7ZBncjLBrugGxWcTR15+mgy53MtQ9fZzAtsieEj8+uqI4iyhInXf/4a7EXqg96+vsw2qAoIpr0iqeHgjTbcvVt/+v+fW/V9sGeFYd6ttn1jRj/VQDA3zGSxH00KeUNxBfZgW6u7zhg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.210.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-ot1-f77.google.com with SMTP id 46e09a7af769-7e60b15b7dbso180440a34.1 for ; Thu, 21 May 2026 22:20:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779427238; x=1780032038; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZEeJFwmdt7F/FZu5QPiPUGXHxEjq2G3AcpFVdYudJpI=; b=IV0V21jcFo7yFeGYAjaIx7m+JdD9P2uVOc7JMNvjjW3JekUPzL0peaoXQlBybcEXuJ Q6lupeMumdzq5+Pmyf4tzsZUGDpukwOeRtFFIueP1OPbDkkDoRKggBrrwH4JFRd8FnrL YS3NawFLEun7OrNtxrmYHYZg/gWIyaT32HcOQ21J3kZhAMrpZezxvny+V3qFnaNTrb5m K7UAleXduvnIkhm7xGoqO3/Bjk/47JWRXCOYnJ8yyGcofug4FPIsoML6vRMHbbqBP4p2 d5E5ZqBaQSEe+1yUeURDPxCCrVcLEbuwV4L9YrdaMHXEsEgAbCFH/II3p3zaNYnqF1y3 tx2A== X-Forwarded-Encrypted: i=1; AFNElJ9ylKEcm5WGCR2y+suN2anjMAokm3BIOI5QH7VxBeQIijMZS0YAXcMjtDUYbI9g4QwfW2Ye0fcvWtsKZKw=@vger.kernel.org X-Gm-Message-State: AOJu0YzUPeB6+AERQMbW25wpj5+Ky5j+DfgJS7uoVLHk+wFcbd/ZOX8b E+UTQinhTlUitwl3Ddn57FoD4zUXbyPZ5GP4AyYL/VUqAHk/qO5oia/fGePYXZT65fBNbbBXnS0 gofgK59rUrZKJJrZA45qQg2gEhAUp5MzjvZLjpgvm5oKDZLiMgNqkAxbZ+pQ= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:c003:b0:696:93e7:fddb with SMTP id 006d021491bc7-69d6e36dd06mr2012540eaf.29.1779427238532; Thu, 21 May 2026 22:20:38 -0700 (PDT) Date: Thu, 21 May 2026 22:20:38 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a0fe7a6.170a0220.2e5ec6.0003.GAE@google.com> Subject: [syzbot] [mm?] BUG: sleeping function called from invalid context in shmem_inode_acct_blocks From: syzbot To: akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, hughd@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Hello, syzbot found the following issue on: HEAD commit: f2abc305aa93 riscv: Define __riscv_copy_{,vec_}{words,byte.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next console output: https://syzkaller.appspot.com/x/log.txt?x=15b358c8580000 kernel config: https://syzkaller.appspot.com/x/.config?x=1cf93e35eaea44b1 dashboard link: https://syzkaller.appspot.com/bug?extid=7978e769e19888e1171e compiler: riscv64-linux-gnu-gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44 userspace arch: riscv64 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/a741b348759c/non_bootable_disk-f2abc305.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/94904c75b810/vmlinux-f2abc305.xz kernel image: https://storage.googleapis.com/syzbot-assets/2195b3067ea1/Image-f2abc305.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+7978e769e19888e1171e@syzkaller.appspotmail.com BUG: sleeping function called from invalid context at mm/shmem.c:230 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 3023, name: syslogd preempt_count: 0, expected: 0 RCU nest depth: 2, expected: 0 4 locks held by syslogd/3023: #0: ffffaf801c0dc410 (sb_writers#5){.+.+}-{0:0}, at: percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] #0: ffffaf801c0dc410 (sb_writers#5){.+.+}-{0:0}, at: __sb_start_write include/linux/fs/super.h:19 [inline] #0: ffffaf801c0dc410 (sb_writers#5){.+.+}-{0:0}, at: sb_start_write include/linux/fs/super.h:125 [inline] #0: ffffaf801c0dc410 (sb_writers#5){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2724 [inline] #0: ffffaf801c0dc410 (sb_writers#5){.+.+}-{0:0}, at: vfs_write+0x8a0/0xc78 fs/read_write.c:684 #1: ffffaf801cacb280 (&sb->s_type->i_mutex_key#14){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1029 [inline] #1: ffffaf801cacb280 (&sb->s_type->i_mutex_key#14){+.+.}-{4:4}, at: shmem_file_write_iter+0x78/0x138 mm/shmem.c:3468 #2: ffffffff887f4120 (rcu_read_lock){....}-{1:3}, at: folio_pgdat include/linux/mm.h:2495 [inline] #2: ffffffff887f4120 (rcu_read_lock){....}-{1:3}, at: lruvec_stat_mod_folio+0x5a/0x25c mm/memcontrol.c:971 #3: ffffffff887f4120 (rcu_read_lock){....}-{1:3}, at: folio_pgdat include/linux/mm.h:2495 [inline] #3: ffffffff887f4120 (rcu_read_lock){....}-{1:3}, at: lruvec_stat_mod_folio+0x5a/0x25c mm/memcontrol.c:971 CPU: 1 UID: 0 PID: 3023 Comm: syslogd Tainted: G W syzkaller #0 PREEMPT Tainted: [W]=WARN Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:149 [] show_stack+0x30/0x3c arch/riscv/kernel/stacktrace.c:155 [] __dump_stack lib/dump_stack.c:94 [inline] [] dump_stack_lvl+0x114/0x1ac lib/dump_stack.c:120 [] dump_stack+0x1c/0x28 lib/dump_stack.c:129 [] __might_resched+0x556/0x5b4 kernel/sched/core.c:9162 [] __might_sleep+0x80/0xc4 kernel/sched/core.c:9091 [] shmem_inode_acct_blocks+0xaa/0x410 mm/shmem.c:230 [] shmem_alloc_and_add_folio+0x544/0x1a1c mm/shmem.c:2005 [] shmem_get_folio_gfp+0x5ea/0x173c mm/shmem.c:2564 [] shmem_get_folio mm/shmem.c:2670 [inline] [] shmem_write_begin+0x17e/0x360 mm/shmem.c:3303 [] generic_perform_write+0x23e/0x944 mm/filemap.c:4325 [] shmem_file_write_iter+0x110/0x138 mm/shmem.c:3478 [] new_sync_write fs/read_write.c:595 [inline] [] vfs_write+0x648/0xc78 fs/read_write.c:688 [] ksys_write+0x126/0x238 fs/read_write.c:740 [] __do_sys_write fs/read_write.c:751 [inline] [] __se_sys_write fs/read_write.c:748 [inline] [] __riscv_sys_write+0x6e/0x94 fs/read_write.c:748 [] syscall_handler+0x92/0x114 arch/riscv/include/asm/syscall.h:112 [] do_trap_ecall_u+0x3dc/0x61c arch/riscv/kernel/traps.c:342 [] handle_exception+0x15e/0x16a arch/riscv/kernel/entry.S:232 ================================================ WARNING: lock held when returning to user space! syzkaller #0 Tainted: G W ------------------------------------------------ syslogd/3023 is leaving the kernel with locks still held! 2 locks held by syslogd/3023: #0: ffffffff887f4120 (rcu_read_lock){....}-{1:3}, at: folio_pgdat include/linux/mm.h:2495 [inline] #0: ffffffff887f4120 (rcu_read_lock){....}-{1:3}, at: lruvec_stat_mod_folio+0x5a/0x25c mm/memcontrol.c:971 #1: ffffffff887f4120 (rcu_read_lock){....}-{1:3}, at: folio_pgdat include/linux/mm.h:2495 [inline] #1: ffffffff887f4120 (rcu_read_lock){....}-{1:3}, at: lruvec_stat_mod_folio+0x5a/0x25c mm/memcontrol.c:971 ------------[ cut here ]------------ Voluntary context switch within RCU read-side critical section! --- 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@googlegroups.com. 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 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