In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: Fix double uncharge the mem of sk_msg
If tcpbpfsendmsg is running during a tear down operation, psock may be freed.
tcpbpfsendmsg() tcpbpfsendverdict() skmsgreturn() tcpbpfsendmsgredir() unlikely(!psock)) skmsgfree()
The mem of msg has been uncharged in tcpbpfsendverdict() by skmsgreturn(), and would be uncharged by skmsgfree() again. When psock is null, we can simply returning an error code, this would then trigger the skmsgfreenocharge in the error path of _SKREDIRECT and would have the side effect of throwing an error up to user space. This would be a slight change in behavior from user side but would look the same as an error if the redirect on the socket threw an error.
This issue can cause the following info: WARNING: CPU: 0 PID: 2136 at net/ipv4/afinet.c:155 inetsockdestruct+0x13c/0x260 Call Trace: <TASK> _skdestruct+0x24/0x1f0 skpsockdestroy+0x19b/0x1c0 processonework+0x1b3/0x3c0 workerthread+0x30/0x350 ? processonework+0x3c0/0x3c0 kthread+0xe6/0x110 ? kthreadcompleteandexit+0x20/0x20 retfrom_fork+0x22/0x30 </TASK>