From nobody Sat Feb 7 15:11:11 2026 Received: from mail-il1-f208.google.com (mail-il1-f208.google.com [209.85.166.208]) (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 C0F132F3638 for ; Mon, 10 Nov 2025 20:58:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.208 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762808317; cv=none; b=Gq0au8iYjCIRzQWWthSNhwAtMms3tQ2GxpMdInvrd6y5w1ECm71MNQZHE42HBbDGionwfkz8EbW6A+w/kRUlRf6xhANdW37r9cwHaMgRZJf92kXoTlPHPvZS6SxcW8BRWPzW8laFSRyKRM/kh2FT7Hb3pXO6wa2QgLN/gdW0nvk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762808317; c=relaxed/simple; bh=851bXe5aQTwdZty53jaIVbICFA09xB27jhrqcmzMOeo=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=PviEH+sBsPouLUW0p/e16PYkcQLBiN1WxSMId90eSuyfldPPKh9liXpbsGPOVPCoz2iUIq1caC8lk1NVr0ioK6fEUcjkZwPubEbItb3aodxZwGq9lKHTMm3ydOZTMsdNH6o79+uNLw55hUtN7w91LdoF3HG4DNitSaeGnQGo8IE= 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.166.208 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-il1-f208.google.com with SMTP id e9e14a558f8ab-4337853ffbbso24296595ab.0 for ; Mon, 10 Nov 2025 12:58:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762808315; x=1763413115; 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=ewq5bkR2w0X36y1ORHARtnHAU9dh8AjYpqdGWpuZkcU=; b=FPreqNnOGzm4aXr/IO9RczURiWp/K0NIzechasE008O90B3txpJvA1XlLvZKlC1hri 9rC2bAPHpcSD3gAUgTMopVZzP/K0VaeV7yfNnXEhNpk7zs6YAk+xZqa7DnO8g9DujMaD zc5rL2TZDXEXcQ1hlQI42UK0L1HlJCTexDA+ZCJpWvQ42boYCFYz/FE7J9tiKUFcEqlN /6lNcePVkbyaPPR3OH/oCDPqkshmHyh/JzY3w/qEnlaEWbn026fTRhRBBiujZAG4Zy2n 9bJEdQ7dWlezv43DdF6+XMN9Xa12tPl2EzGRY4al+6kz+yyBMG5FEcULr/nsouE4TTkU 4KhA== X-Gm-Message-State: AOJu0YwkfxjIO1OQjcFqvIZAjJTI0HIC/QirMlLYmWR/ChULhduWeisu Cj2ZOSjOVNM/KHVEf9xlV1JbZLceEVxLpl48VBqHCT5oYn/eZtT7HN8vS7VF03KsyQ0iUhAZs18 NqtiEVaqHiqhipzM21P/O94hOMZX2BKD/ECJxSM106eVqkgp2SlrTRqX1XbPKoQ== X-Google-Smtp-Source: AGHT+IFs8PmXv1l0MCHu7y8xC2O43VtMVeNlEDUBcALH6HzyoOfwZVS0gNRgK5upRzWjAbyu1RXZ+96miWUetA8+MKFhyqLGl75K Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a92:c265:0:b0:433:7b4f:f8c3 with SMTP id e9e14a558f8ab-4337b502724mr85243475ab.17.1762808314620; Mon, 10 Nov 2025 12:58:34 -0800 (PST) Date: Mon, 10 Nov 2025 12:58:34 -0800 In-Reply-To: <691231dc.a70a0220.22f260.0101.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <691251fa.a70a0220.22f260.010a.GAE@google.com> Subject: Forwarded: Re: [syzbot] [bpf?] KASAN: stack-out-of-bounds Write in __bpf_get_stack 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: Re: [syzbot] [bpf?] KASAN: stack-out-of-bounds Write in __bpf_get_= stack Author: listout@listout.xyz On 10.11.2025 10:41, syzbot wrote: > Hello, >=20 > syzbot found the following issue on: >=20 > HEAD commit: f8c67d8550ee bpf: Use kmalloc_nolock() in range tree > git tree: bpf-next > console output: https://syzkaller.appspot.com/x/log.txt?x=3D121a50b4580000 > kernel config: https://syzkaller.appspot.com/x/.config?x=3De46b8a1c64546= 5a9 > dashboard link: https://syzkaller.appspot.com/bug?extid=3Dd1b7fa1092def36= 28bd7 > compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b797= 6-1~exp1~20250708183702.136), Debian LLD 20.1.8 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=3D12270412580= 000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=3D128bd084580000 >=20 > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/d9e95bfbe4ee/dis= k-f8c67d85.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/0766b6dd0e91/vmlinu= x-f8c67d85.xz > kernel image: https://storage.googleapis.com/syzbot-assets/79089f9e9e93/b= zImage-f8c67d85.xz >=20 > The issue was bisected to: >=20 > commit e17d62fedd10ae56e2426858bd0757da544dbc73 > Author: Arnaud Lecomte > Date: Sat Oct 25 19:28:58 2025 +0000 >=20 > bpf: Refactor stack map trace depth calculation into helper function >=20 > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=3D1632d0b458= 0000 > final oops: https://syzkaller.appspot.com/x/report.txt?x=3D1532d0b458= 0000 > console output: https://syzkaller.appspot.com/x/log.txt?x=3D1132d0b4580000 >=20 > IMPORTANT: if you fix the issue, please add the following tag to the comm= it: > Reported-by: syzbot+d1b7fa1092def3628bd7@syzkaller.appspotmail.com > Fixes: e17d62fedd10 ("bpf: Refactor stack map trace depth calculation int= o helper function") >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > BUG: KASAN: stack-out-of-bounds in __bpf_get_stack+0x5a3/0xaa0 kernel/bpf= /stackmap.c:493 > Write of size 168 at addr ffffc900030e73a8 by task syz.1.44/6108 #syz test diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c index 2365541c81dd..885130e4ab0d 100644 --- a/kernel/bpf/stackmap.c +++ b/kernel/bpf/stackmap.c @@ -480,6 +480,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struc= t task_struct *task, } =20 trace_nr =3D trace->nr - skip; + trace_nr =3D min_t(u32, trace_nr, size / elem_size); copy_len =3D trace_nr * elem_size; =20 ips =3D trace->ip + skip; --=20 Regards, listout