From: syzbot <syzbot+c950cc277150935cc0b5@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Forwarded: WARNING in reg_bounds_sanity_check (2)
Date: Sat, 13 Sep 2025 13:47:26 -0700 [thread overview]
Message-ID: <68c5d85e.050a0220.3c6139.04d6.GAE@google.com> (raw)
In-Reply-To: <68bacb3e.050a0220.192772.018d.GAE@google.com>
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
next prev parent reply other threads:[~2025-09-13 20:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2025-09-13 21:17 ` Forwarded: [PATCH] " syzbot
2025-09-13 21:56 ` Forwarded: [PATCH V2] " syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=68c5d85e.050a0220.3c6139.04d6.GAE@google.com \
--to=syzbot+c950cc277150935cc0b5@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.