On Tue, Oct 24, 2023 at 7:46 AM Daniel Borkmann <daniel@xxxxxxxxxxxxx> wrote: > > On 10/18/23 8:03 PM, Song Liu wrote: > [...] > > @@ -1040,6 +1038,38 @@ arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image > > return -ENOTSUPP; > > } > > > > +void * __weak arch_alloc_bpf_trampoline(int size) > > +{ > > + void *image; > > + > > + WARN_ON_ONCE(size > PAGE_SIZE || size <= 0); > > non-blocking / can be follow-up, but why not: > > if (WARN_ON_ONCE(size > PAGE_SIZE || size <= 0)) > return NULL > > size could also be u32, then you don't need size <= 0 check ? Thanks for the suggestion! The code will indeed be cleaner with these changes. Song