summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2026-07-19 17:36:28 +0200
committerEduard Zingerman <eddyz87@gmail.com>2026-07-21 16:31:48 -0700
commit04e19012efaec2bfd8c3b37fd8a6c3f1fe731ffc (patch)
treedd48f8d24839688fb16f228eb9040b3d27aa6142
parentfcac2b4a3bdfbb6bd34ef671f0e77ccaa3051c5b (diff)
downloadlinux-04e19012efaec2bfd8c3b37fd8a6c3f1fe731ffc.tar.gz
linux-04e19012efaec2bfd8c3b37fd8a6c3f1fe731ffc.zip
bpf: Fix offset warn check for bpf_res_spin_lock
Sashiko pointed out correctly that the case statement for BPF_RES_SPIN_LOCK incorrectly checks offset for BPF_SPIN_LOCK. Fix it by checking res_spin_lock_off instead. Fixes: 0de2046137f9 ("bpf: Implement verifier support for rqspinlock") Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://patch.msgid.link/20260719153634.2908692-2-memxor@gmail.com Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
-rw-r--r--kernel/bpf/btf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index cbb1e49b9bcb..e7d4e9ba24e2 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -4168,7 +4168,7 @@ struct btf_record *btf_parse_fields(const struct btf *btf, const struct btf_type
rec->spin_lock_off = rec->fields[i].offset;
break;
case BPF_RES_SPIN_LOCK:
- WARN_ON_ONCE(rec->spin_lock_off >= 0);
+ WARN_ON_ONCE(rec->res_spin_lock_off >= 0);
/* Cache offset for faster lookup at runtime */
rec->res_spin_lock_off = rec->fields[i].offset;
break;