From nobody Sun Feb 8 01:33:30 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 4B68B2F998D for ; Mon, 10 Nov 2025 19:17:42 +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=1762802264; cv=none; b=esx3XiJw5aeNr2JxkI/nil+tuSJlSRibUJ/qZO1TMVug6OaqMUYFaiXgCBkduY/1wsqB1c3uqT9nxC5gAO8F1dSHW4XlfB5X0OF3EkWjQOz8UPhSJ64wQA/SU+08xoEXcAK+4Bdi2GgsAcNScazRtm96NVin50Ko45D0VMMT88g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762802264; c=relaxed/simple; bh=7ohetOPU9prv4mlmaLaH231JyuqfOgFwKopQ/P2r/kM=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=AxjgA97Wyairu5w0YnFegA1aCAZjm2u1Eg0RPkhhdxMmNxcQ6eG/J19ItxDbw5jOCcxRnFMP+tv4hjgTHnPHPoEdd8puFP3pMSmuFybv8IG+eqmYL1nmGXgc/5s9ONdrNdJqL4F5do5rK1Ay63BQY3MHihga9qU7SCTbDClalOQ= 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-43330d77c3aso125254765ab.3 for ; Mon, 10 Nov 2025 11:17:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762802260; x=1763407060; 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=w+Dh0ealzLswN7Gxp1zzcu4/uoupEjjUgbERz4XZ1Sg=; b=j49Tpl5KyRkrqiv/hUB1CQfPY3VpRosn7gB85R0gi7DO2lMpXC9KuQs79kjoDu+Qd5 T91iftwi7X4NywdvGCRaDDevmUq73XePmmluTjOzB1AfDm24KXx11C3ybLRsaSTyjRMI q/VpqVJrKyAGvf/IT2HrbTQzcB4zgufxTFq9J0h6bMgpaC+ATlu4JDx0NolYgm6QsiNS QXZwrp3bXTUJHYdkXSWt71OWmhfbr2upir9Q8KPIqm97kI8HQiTfD/a+PQI5rzdvdHYz Z5bLEPeOg+KwJSHUuy/3YbypGjLnj9hamClz+QxM0BcS5wkZmGxqjNUbXQXlbeTVZYPi Vz6g== X-Gm-Message-State: AOJu0YwUZtpQvluJBhIiTFwReYUoycuhcI38jH/cMFmx79UYLzaA1XAc RvKZKdfREuFeMS4vQgcuBGR6AbjA6Ld9RTEOXtN42vRde4Pjwby7eqhFr89ZLrEmfNzo5B93ZDs 5FIX25NExZ2A0enF85nfj2YbtJRB2835ZKuZhjBAjC2ykM9VXssAiLKhoYemigg== X-Google-Smtp-Source: AGHT+IH9OChcdileBDQQgNqD0jYcbx5Tm8L5dA5BY9/3WEhH4uM/YXtub4bfO0nDIpcQfNv9cAy5r6Eno3hWNcoC0rs2DnhHXq8o 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:7d68:d579 with SMTP id e9e14a558f8ab-4337d68d630mr79207255ab.31.1762802260072; Mon, 10 Nov 2025 11:17:40 -0800 (PST) Date: Mon, 10 Nov 2025 11:17:40 -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: <69123a54.a70a0220.22f260.0104.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 #syz test diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c index 2365541c81dd..2db09ce39828 100644 --- a/kernel/bpf/stackmap.c +++ b/kernel/bpf/stackmap.c @@ -480,7 +480,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struc= t task_struct *task, } =20 trace_nr =3D trace->nr - skip; - copy_len =3D trace_nr * elem_size; + /*copy_len =3D trace_nr * elem_size;*/ =20 ips =3D trace->ip + skip; if (user_build_id) { @@ -490,7 +490,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struc= t task_struct *task, for (i =3D 0; i < trace_nr; i++) id_offs[i].ip =3D ips[i]; } else { - memcpy(buf, ips, copy_len); + memcpy(buf, ips, trace_nr); } =20 /* trace/ips should not be dereferenced after this point */ --=20 Regards, listout