This my V2 of catching XDP_REDIRECT and bpf_redirect_map() API usage that can potentially crash the kernel. Addressed Daniels feedback in patch01, and added patch02 which catch and cleanup dangling map pointers.
I know John and Daniel are working on a more long-term solution, of recording the bpf_prog pointer together with the map pointer. I just wanted to propose these fixes as a stop-gap to the potential crashes. --- Jesper Dangaard Brouer (2): xdp: implement xdp_redirect_map for generic XDP xdp: catch invalid XDP_REDIRECT API usage include/linux/filter.h | 1 + include/trace/events/xdp.h | 4 ++-- net/core/dev.c | 3 +++ net/core/filter.c | 39 ++++++++++++++++++++++++++++++++++++--- 4 files changed, 42 insertions(+), 5 deletions(-) --