public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [bpf?] WARNING in reg_bounds_sanity_check (2)
@ 2025-09-05 11:36 syzbot
  2025-09-06  1:58 ` syzbot
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: syzbot @ 2025-09-05 11:36 UTC (permalink / raw)
  To: andrii, ast, bpf, daniel, eddyz87, haoluo, john.fastabend, jolsa,
	kpsingh, linux-kernel, martin.lau, sdf, song, syzkaller-bugs,
	yonghong.song

Hello,

syzbot found the following issue on:

HEAD commit:    d69eb204c255 Merge tag 'net-6.17-rc5' of git://git.kernel...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12b2c962580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=d4703ac89d9e185a
dashboard link: https://syzkaller.appspot.com/bug?extid=c950cc277150935cc0b5
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=15921962580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=157da134580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1514db72e485/disk-d69eb204.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0d9a4986a33d/vmlinux-d69eb204.xz
kernel image: https://storage.googleapis.com/syzbot-assets/4182b32d3ada/bzImage-d69eb204.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c950cc277150935cc0b5@syzkaller.appspotmail.com

verifier bug: REG INVARIANTS VIOLATION (false_reg1): range bounds violation u64=[0xfffffffefffff630, 0xffffffff00000000] s64=[0xfffffffefffff630, 0xffffffff00000000] u32=[0x30, 0x8000050] s32=[0x30, 0x0] var_off=(0xfffffffe00000030, 0x10fffffc0)(1)
WARNING: CPU: 0 PID: 6017 at kernel/bpf/verifier.c:2722 reg_bounds_sanity_check+0x62b/0x1200 kernel/bpf/verifier.c:2722
Modules linked in:
CPU: 0 UID: 0 PID: 6017 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:reg_bounds_sanity_check+0x62b/0x1200 kernel/bpf/verifier.c:2722
Code: 45 ac 50 8b 45 b0 50 8b 45 b4 50 ff 75 b8 4c 8b 4d c0 4c 8b 45 c8 48 8b 95 58 ff ff ff 48 8b b5 60 ff ff ff e8 96 76 aa ff 90 <0f> 0b 90 90 48 8b 95 40 ff ff ff 48 83 c4 38 48 b8 00 00 00 00 00
RSP: 0018:ffffc900040272f8 EFLAGS: 00010286
RAX: 0000000000000000 RBX: fffffffefffff630 RCX: ffffffff817a3388
RDX: ffff88807c9d4880 RSI: ffffffff817a3395 RDI: 0000000000000001
RBP: ffffc900040273f0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff88807b5b8000
R13: ffff8880771591bc R14: ffff8880771591b4 R15: ffff888077159168
FS:  0000555583a7e500(0000) GS:ffff8881246b6000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcb2ddc7dac CR3: 0000000077c90000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 reg_set_min_max kernel/bpf/verifier.c:16336 [inline]
 reg_set_min_max+0x1dc/0x2c0 kernel/bpf/verifier.c:16308
 check_cond_jmp_op+0x19b0/0x72d0 kernel/bpf/verifier.c:16768
 do_check_insn kernel/bpf/verifier.c:19956 [inline]
 do_check kernel/bpf/verifier.c:20093 [inline]
 do_check_common+0xa13e/0xb410 kernel/bpf/verifier.c:23260
 do_check_main kernel/bpf/verifier.c:23343 [inline]
 bpf_check+0x869f/0xc670 kernel/bpf/verifier.c:24703
 bpf_prog_load+0xe41/0x2490 kernel/bpf/syscall.c:2979
 __sys_bpf+0x4a3f/0x4de0 kernel/bpf/syscall.c:6029
 __do_sys_bpf kernel/bpf/syscall.c:6139 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:6137 [inline]
 __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:6137
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcb2db8ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdf04b3dd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fcb2ddc5fa0 RCX: 00007fcb2db8ebe9
RDX: 0000000000000048 RSI: 00002000000017c0 RDI: 0000000000000005
RBP: 00007fcb2dc11e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fcb2ddc5fa0 R14: 00007fcb2ddc5fa0 R15: 0000000000000003
 </TASK>


---
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 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [syzbot] [bpf?] WARNING in reg_bounds_sanity_check (2)
  2025-09-05 11:36 [syzbot] [bpf?] WARNING in reg_bounds_sanity_check (2) syzbot
@ 2025-09-06  1:58 ` syzbot
  2025-09-13 20:47 ` Forwarded: " syzbot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2025-09-06  1:58 UTC (permalink / raw)
  To: andrii, ast, bpf, daniel, eddyz87, haoluo, john.fastabend, jolsa,
	kpsingh, linux-kernel, martin.lau, paul.chaignon, sdf, song,
	syzkaller-bugs, yonghong.song

syzbot has bisected this issue to:

commit 0df1a55afa832f463f9ad68ddc5de92230f1bc8a
Author: Paul Chaignon <paul.chaignon@gmail.com>
Date:   Tue Jul 1 18:36:15 2025 +0000

    bpf: Warn on internal verifier errors

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13652962580000
start commit:   d69eb204c255 Merge tag 'net-6.17-rc5' of git://git.kernel...
git tree:       upstream
final oops:     https://syzkaller.appspot.com/x/report.txt?x=10e52962580000
console output: https://syzkaller.appspot.com/x/log.txt?x=17652962580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=d4703ac89d9e185a
dashboard link: https://syzkaller.appspot.com/bug?extid=c950cc277150935cc0b5
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17da1962580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=103a1962580000

Reported-by: syzbot+c950cc277150935cc0b5@syzkaller.appspotmail.com
Fixes: 0df1a55afa83 ("bpf: Warn on internal verifier errors")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Forwarded: WARNING in reg_bounds_sanity_check (2)
  2025-09-05 11:36 [syzbot] [bpf?] WARNING in reg_bounds_sanity_check (2) syzbot
  2025-09-06  1:58 ` syzbot
@ 2025-09-13 20:47 ` syzbot
  2025-09-13 21:17 ` Forwarded: [PATCH] " syzbot
  2025-09-13 21:56 ` Forwarded: [PATCH V2] " syzbot
  3 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2025-09-13 20:47 UTC (permalink / raw)
  To: linux-kernel

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: WARNING in reg_bounds_sanity_check (2)
Author: kriish.sharma2006@gmail.com

#syz test

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index c4f69a9e9af6..4c6000d32f46 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -16299,6 +16299,15 @@ static void regs_refine_cond_op(struct
bpf_reg_state *reg1, struct bpf_reg_state
        }
 }

+static void __maybe_normalize_reg(struct bpf_reg_state *reg)
+{
+    if (reg->umin_value > reg->umax_value ||
+        reg->smin_value > reg->smax_value ||
+        reg->u32_min_value > reg->u32_max_value ||
+        reg->s32_min_value > reg->s32_max_value)
+        __mark_reg_unbounded(reg);
+}
+
 /* Adjusts the register min/max values in the case that the dst_reg and
  * src_reg are both SCALAR_VALUE registers (or we are simply doing a BPF_K
  * check, in which case we have a fake SCALAR_VALUE representing
insn->imm).
@@ -16325,11 +16334,15 @@ static int reg_set_min_max(struct
bpf_verifier_env *env,
        regs_refine_cond_op(false_reg1, false_reg2, rev_opcode(opcode),
is_jmp32);
        reg_bounds_sync(false_reg1);
        reg_bounds_sync(false_reg2);
+       __maybe_normalize_reg(false_reg1);
+    __maybe_normalize_reg(false_reg2);

        /* jump (TRUE) branch */
        regs_refine_cond_op(true_reg1, true_reg2, opcode, is_jmp32);
        reg_bounds_sync(true_reg1);
        reg_bounds_sync(true_reg2);
+       __maybe_normalize_reg(true_reg1);
+    __maybe_normalize_reg(true_reg2);

        err = reg_bounds_sanity_check(env, true_reg1, "true_reg1");
        err = err ?: reg_bounds_sanity_check(env, true_reg2, "true_reg2");
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Forwarded: [PATCH] WARNING in reg_bounds_sanity_check (2)
  2025-09-05 11:36 [syzbot] [bpf?] WARNING in reg_bounds_sanity_check (2) syzbot
  2025-09-06  1:58 ` syzbot
  2025-09-13 20:47 ` Forwarded: " syzbot
@ 2025-09-13 21:17 ` syzbot
  2025-09-13 21:56 ` Forwarded: [PATCH V2] " syzbot
  3 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2025-09-13 21:17 UTC (permalink / raw)
  To: linux-kernel

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: [PATCH] WARNING in reg_bounds_sanity_check (2)
Author: kriish.sharma2006@gmail.com

#syz test

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Forwarded: [PATCH V2] WARNING in reg_bounds_sanity_check (2)
  2025-09-05 11:36 [syzbot] [bpf?] WARNING in reg_bounds_sanity_check (2) syzbot
                   ` (2 preceding siblings ...)
  2025-09-13 21:17 ` Forwarded: [PATCH] " syzbot
@ 2025-09-13 21:56 ` syzbot
  3 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2025-09-13 21:56 UTC (permalink / raw)
  To: linux-kernel

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: [PATCH V2] WARNING in reg_bounds_sanity_check (2)
Author: kriish.sharma2006@gmail.com

#syz test

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-13 21:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 11:36 [syzbot] [bpf?] WARNING in reg_bounds_sanity_check (2) syzbot
2025-09-06  1:58 ` syzbot
2025-09-13 20:47 ` Forwarded: " syzbot
2025-09-13 21:17 ` Forwarded: [PATCH] " syzbot
2025-09-13 21:56 ` Forwarded: [PATCH V2] " syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox