In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix KASAN use-after-free Read in computeeffectiveprogs
Syzbot found a Use After Free bug in computeeffectiveprogs(). The reproducer creates a number of BPF links, and causes a fault injected alloc to fail, while calling bpflinkdetach on them. Link detach triggers the link to be freed by bpflinkfree(), which calls _cgroupbpfdetach() and updateeffectiveprogs(). If the memory allocation in this function fails, the function restores the pointer to the bpfcgrouplink on the cgroup list, but the memory gets freed just after it returns. After this, every subsequent call to updateeffectiveprogs() causes this already deallocated pointer to be dereferenced in proglist_length(), and triggers KASAN UAF error.
To fix this issue don't preserve the pointer to the prog or link in the list, but remove it and replace it with a dummy prog without shrinking the table. The subsequent call to _cgroupbpfdetach() or _cgroupbpfdetach() will correct it.