> syzbot tried to test the proposed patch but the build/boot failed:
>
> failed to apply patch:
> checking file kernel/bpf/verifier.c
> patch: **** unexpected end of file in patch
Oh, something wrong with format, such as trailing space...?
#syz test
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 3303a3605ee8..0120cc325078 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -7788,6 +7788,12 @@ static int check_atomic_rmw(struct bpf_verifier_env *env,
static int check_atomic_load(struct bpf_verifier_env *env,
struct bpf_insn *insn)
{
+ int err;
+
+ err = check_load_mem(env, insn, true, false, false, "atomic_load");
+ if (err)
+ return err;
+
if (!atomic_ptr_type_ok(env, insn->src_reg, insn)) {
verbose(env, "BPF_ATOMIC loads from R%d %s is not allowed\n",
insn->src_reg,
@@ -7795,12 +7801,18 @@ static int check_atomic_load(struct bpf_verifier_env *env,
return -EACCES;
}
- return check_load_mem(env, insn, true, false, false, "atomic_load");
+ return 0;
}
static int check_atomic_store(struct bpf_verifier_env *env,
struct bpf_insn *insn)
{
+ int err;
+
+ err = check_store_reg(env, insn, true);
+ if (err)
+ return err;
+
if (!atomic_ptr_type_ok(env, insn->dst_reg, insn)) {
verbose(env, "BPF_ATOMIC stores into R%d %s is not allowed\n",
insn->dst_reg,
@@ -7808,7 +7820,7 @@ static int check_atomic_store(struct bpf_verifier_env *env,
return -EACCES;
}
- return check_store_reg(env, insn, true);
+ return 0;
}
static int check_atomic(struct bpf_verifier_env *env, struct bpf_insn *insn)
--
2.48.1
Hello, syzbot has tested the proposed patch and the reproducer did not trigger any issue: Reported-by: syzbot+a5964227adc0f904549c@syzkaller.appspotmail.com Tested-by: syzbot+a5964227adc0f904549c@syzkaller.appspotmail.com Tested on: commit: 2d7597d6 selftests/bpf: Fix sockopt selftest failure o.. git tree: bpf-next console output: https://syzkaller.appspot.com/x/log.txt?x=1397704c580000 kernel config: https://syzkaller.appspot.com/x/.config?x=b7bde34acd8f53b1 dashboard link: https://syzkaller.appspot.com/bug?extid=a5964227adc0f904549c compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 patch: https://syzkaller.appspot.com/x/patch.diff?x=1188ae54580000 Note: testing is done by a robot and is best-effort only.
© 2016 - 2025 Red Hat, Inc.