From: Martin KaFai Lau Date: Tue, 12 Sep 2023 05:06:06 +0000 (-0700) Subject: Merge branch 'Avoid dummy bpf_offload_netdev in __bpf_prog_dev_bound_init' X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4a490247beba92d3a77485b43f7e98a84be26c46;p=users%2Fjedix%2Flinux-maple.git Merge branch 'Avoid dummy bpf_offload_netdev in __bpf_prog_dev_bound_init' Eduard Zingerman says: ==================== For a device bound BPF program with flag BPF_F_XDP_DEV_BOUND_ONLY, in case if device does not support offload, __bpf_prog_dev_bound_init() creates a dummy bpf_offload_netdev struct with .offdev field set to NULL. This dummy struct might be reused for programs without this flag bound to the same device. However, bpf_prog_offload_verifier_prep() that uses bpf_offload_netdev assumes that .offdev field cannot be NULL. This bug was reported by syzbot in [1]. [1] https://lore.kernel.org/bpf/000000000000d97f3c060479c4f8@google.com/ ==================== Signed-off-by: Martin KaFai Lau --- 4a490247beba92d3a77485b43f7e98a84be26c46