On 30/10/2023 13:48, Zachary Leaf wrote:
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 6c8594a0f883..e056737bc823 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -59,6 +59,19 @@ extern struct kobject *btf_kobj; extern struct bpf_mem_alloc bpf_global_ma; extern bool bpf_global_ma_set; +#define __bpf_put_uattr(x, uattr, to_field) \
- (put_user(x, &((uattr)->to_field)))
+#define bpf_put_uattr(x, uattr, to_field) \
- (in_compat_syscall() ? \
Maybe those (and bpfptr_put_uattr()) should use in_compat64_syscall() as well. That would avoid generating extra code in compat32.
Kevin