diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index a60a6a2ce0d7..fbfb1eed5a1f 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -89,6 +89,15 @@ void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, int k, uns return NULL; } +/* + * Android uses __PAGE_SIZE for larger than 4KB base page size emulation + * on x86_64. Undef this to avoid conflicts with bpf core's usage of + * __PAGE_SIZE in this compilation unit. + */ +#ifdef __PAGE_SIZE +#undef __PAGE_SIZE +#endif + /* tell bpf programs that include vmlinux.h kernel's PAGE_SIZE */ enum page_size_enum { __PAGE_SIZE = PAGE_SIZE