From nobody Sat Feb 7 14:16:22 2026 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (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 2A1FD221DB1 for ; Tue, 27 Jan 2026 11:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769512833; cv=none; b=T9rQsJSHNtAC+SDQbYBedvcCTFDsEyNoI6RSV5JnpIfI8fV3e406p+gQ0hucYurlteegqHzd+7wcEt/n1CFJo0n6Jpt1HVxQFo86ij7YCYD8Ri5eFt0MxT0bgm64rx3gBUHcHNp753UKdYjmZB8CQKZ3CgykBuHryCReKUfsDus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769512833; c=relaxed/simple; bh=41HBBtGL0FpCpc/v84inWqenMPDrcN21PzhvCWMGoNw=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=pA0TduSrsTGjYbxp/ePNO544n7TZOg2gwYFEEeOg7B0Id5WLZULNdcoGZWXy0Jp5amGDl4GoASVYV2VkHQIQ0ZtsaAmpcD+x99sLDw2d1PuuQRKwxbXK1wRuI+0x/rs7fZJ4lDi+uY+9Soq3QGVtenKGJ1yKLNQJ9WOc6fxQGCk= 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.161.72 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-oo1-f72.google.com with SMTP id 006d021491bc7-662c4998cbcso17423055eaf.2 for ; Tue, 27 Jan 2026 03:20:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769512831; x=1770117631; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BHNJ9eKy4rqa4UXH1ueV6X6WqclTAW4dMnhPfMTfT2I=; b=F3eg7yAQD0KjcGcsua6ypD1W/NxM0YP07ReoJ7BBbWLztK5Ci8gZKeQ8+HBJPOSTMq 1Ccu2x7O7HFTfoCEWbMsh53Uhu/8Nfgdpy/KRqjCEMROD0jHBBPhvxZW78cmaZyeX7kp LLmMYRqJJP3e+NbdKXKGa4Pzq/e9CgcgSC59gn2J13nMO66usyiG2bIn35Qopjr3qMxC SpTwcMZ2xWU8cfCjuL6LkqnDh/M9dcvDQr7JykQAz8DSGgoJqXSeL2jWOEkE0ap3l5Ky /1Gq161qC9vMWR4625o+9+TpPSqmtDfpy9OWhKjDLoVxTaNo7ngpS0FsqSFJD5JOpafF zrYw== X-Gm-Message-State: AOJu0YwSt+/4ME3qNkHTR0MIH5YiN3VI/rHIJ+qkGWYI6fpYyaxRkiwQ uSdWC+Wp2Y5OSQ60gA0jjDtj86D2HPtQ72fcesJJ18VA3W3S2IVoajd6E5yRsSHupLc4OqA0Std jAifeBWJByFX4pHawSfY9BHQJOYmlzoJuTL5rUb7LPws/i4A5R9unjbt/xB8= 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:1c9c:b0:662:c5a7:dfd2 with SMTP id 006d021491bc7-662f20b026cmr876464eaf.41.1769512831177; Tue, 27 Jan 2026 03:20:31 -0800 (PST) Date: Tue, 27 Jan 2026 03:20:31 -0800 In-Reply-To: <69780fd3.050a0220.c9109.000b.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69789f7f.050a0220.c9109.0019.GAE@google.com> Subject: Forwarded: [PATCH] x86/stacktrace: Prevent RCU stalls during deep stack unwinding From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] x86/stacktrace: Prevent RCU stalls during deep stack unwin= ding Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master When KASAN is enabled, stack unwinding for allocation tracking can become expensive. Real-time tasks that perform many allocations (e.g., VMA operations with maple tree preallocation) can monopolize the CPU during deep stack traces, preventing the RCU grace period kthread from running and causing RCU stalls. Add periodic yielding during stack unwinding to allow other tasks, particularly the RCU grace period kthread, to make progress. Yield every 16 frames or when rescheduling is needed, similar to the approach used in mm/vmalloc.c for KASAN operations. Reported-by: syzbot+316c0070a0341d2661a2@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=3D316c0070a0341d2661a2 Signed-off-by: Deepanshu Kartikey --- arch/x86/kernel/stacktrace.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index ee117fcf46ed..b7d2912a715b 100644 --- a/arch/x86/kernel/stacktrace.c +++ b/arch/x86/kernel/stacktrace.c @@ -17,6 +17,7 @@ void arch_stack_walk(stack_trace_consume_fn consume_entry= , void *cookie, { struct unwind_state state; unsigned long addr; + unsigned int frame_count =3D 0; =20 if (regs && !consume_entry(cookie, regs->ip)) return; @@ -26,6 +27,12 @@ void arch_stack_walk(stack_trace_consume_fn consume_entr= y, void *cookie, addr =3D unwind_get_return_address(&state); if (!addr || !consume_entry(cookie, addr)) break; + + if (IS_ENABLED(CONFIG_KASAN) && + (need_resched() || ++frame_count >=3D 16)) { + cond_resched(); + frame_count =3D 0; + } } } =20 --=20 2.43.0