In the Linux kernel, the following vulnerability has been resolved: bpf: Fix invalid prog->stats access when updateeffectiveprogs fails Syzkaller triggers an invalid memory access issue following fault injection in updateeffectiveprogs. The issue can be described as follows: _cgroupbpfdetach updateeffectiveprogs computeeffectiveprogs bpfprogarrayalloc <-- fault inject purgeeffectiveprogs /* change to dummybpfprog / array->items[index] = &dummy_bpf_prog.prog ---softirq start--- __do_softirq ... __cgroup_bpf_run_filter_skb __bpf_prog_run_save_cb bpf_prog_run stats = this_cpu_ptr(prog->stats) / invalid memory access */ flags = u64statsupdatebeginirqsave(&stats->syncp) ---softirq end--- staticbranchdec(&cgroupbpfenabledkey[atype]) The reason is that fault injection caused updateeffectiveprogs to fail and then changed the original prog into dummybpfprog.prog in purgeeffectiveprogs. Then a softirq came, and accessing the members of dummybpf_prog.prog in the softirq triggers invalid mem access. To fix it, skip updating stats when stats is NULL.