From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+2c29addf92581b410079@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bpf?] KASAN: slab-out-of-bounds Read in strnchr
Date: Wed, 7 Jan 2026 16:47:46 +0800 [thread overview]
Message-ID: <tencent_87C9922EC6EEFC8CAD27C0C6C992CE065306@qq.com> (raw)
In-Reply-To: <695bc686.050a0220.1c677c.032f.GAE@google.com>
#syz test
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index db72b96f9c8c..88da2d0e634c 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -827,7 +827,7 @@ int bpf_bprintf_prepare(const char *fmt, u32 fmt_size, const u64 *raw_args,
char fmt_ptype, cur_ip[16], ip_spec[] = "%pXX";
fmt_end = strnchr(fmt, fmt_size, 0);
- if (!fmt_end)
+ if (!fmt_end || fmt_end == fmt)
return -EINVAL;
fmt_size = fmt_end - fmt;
next prev parent reply other threads:[~2026-01-07 8:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-05 14:11 syzbot
2026-01-06 4:48 ` Forwarded: [PATCH] bpf: Fix double offset in check_reg_const_str() syzbot
2026-01-06 5:19 ` Forwarded: [PATCH] bpf: Fix double offset in insn_array_map_direct_value_addr() syzbot
2026-01-06 15:44 ` Forwarded: [PATCH] bpf: Reject BPF_MAP_TYPE_INSN_ARRAY in check_reg_const_str() syzbot
2026-01-07 8:47 ` Edward Adam Davis [this message]
2026-01-07 9:39 ` [syzbot] [bpf?] KASAN: slab-out-of-bounds Read in strnchr syzbot
2026-01-07 9:39 ` [PATCH] bpf: Format string can't be empty Edward Adam Davis
2026-01-08 3:02 ` Alexei Starovoitov
2026-01-08 3:52 ` Edward Adam Davis
2026-01-08 21:43 ` Alexei Starovoitov
[not found] <20260106044819.20941-1-kartikey406@gmail.com>
2026-01-06 5:12 ` [syzbot] [bpf?] KASAN: slab-out-of-bounds Read in strnchr syzbot
[not found] <20260106051946.22262-1-kartikey406@gmail.com>
2026-01-06 6:23 ` syzbot
[not found] <20260106154351.286607-1-kartikey406@gmail.com>
2026-01-06 16:39 ` 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=tencent_87C9922EC6EEFC8CAD27C0C6C992CE065306@qq.com \
--to=eadavis@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+2c29addf92581b410079@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®