In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: Fix the sk->skforwardalloc warning of skstreamkill_queues
When running test_sockmap
selftests, the following warning appears:
WARNING: CPU: 2 PID: 197 at net/core/stream.c:205 skstreamkillqueues+0xd3/0xf0 Call Trace: <TASK> inetcskdestroysock+0x55/0x110 tcprcvstateprocess+0xd28/0x1380 ? tcpv4dorcv+0x77/0x2c0 tcpv4dorcv+0x77/0x2c0 _releasesock+0x106/0x130 _tcpclose+0x1a7/0x4e0 tcpclose+0x20/0x70 inetrelease+0x3c/0x80 _sockrelease+0x3a/0xb0 sockclose+0x14/0x20 _fput+0xa3/0x260 taskworkrun+0x59/0xb0 exittousermodeprepare+0x1b3/0x1c0 syscallexittousermode+0x19/0x50 dosyscall64+0x48/0x90 entrySYSCALL64after_hwframe+0x44/0xae
The root case is in commit 84472b436e76 ("bpf, sockmap: Fix more uncharged while msg has more_data"), where I used msg->sg.size to replace the tosend, causing breakage:
if (msg->applybytes && msg->applybytes < tosend) tosend = psock->apply_bytes;