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;
{ "vanir_signatures": [ { "signature_type": "Function", "target": { "file": "net/ipv4/tcp_bpf.c", "function": "tcp_bpf_send_verdict" }, "id": "CVE-2022-49877-0883c63f", "digest": { "length": 2221.0, "function_hash": "36804321464058055607092261351928444047" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d975bec1eaeb52341acc9273db79ddb078220399", "signature_version": "v1" }, { "signature_type": "Function", "target": { "file": "net/ipv4/tcp_bpf.c", "function": "tcp_bpf_send_verdict" }, "id": "CVE-2022-49877-1d266349", "digest": { "length": 2221.0, "function_hash": "36804321464058055607092261351928444047" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@14e8bc3bf7bd6af64d7538a0684c8238d96cdfd7", "signature_version": "v1" }, { "signature_type": "Function", "target": { "file": "net/ipv4/tcp_bpf.c", "function": "tcp_bpf_send_verdict" }, "id": "CVE-2022-49877-202507a4", "digest": { "length": 2221.0, "function_hash": "36804321464058055607092261351928444047" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc21dc48a78cc9e5af9a4d039cd456446a6e73ff", "signature_version": "v1" }, { "signature_type": "Function", "target": { "file": "net/ipv4/tcp_bpf.c", "function": "tcp_bpf_send_verdict" }, "id": "CVE-2022-49877-28c03719", "digest": { "length": 2221.0, "function_hash": "36804321464058055607092261351928444047" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ec95b94716a1e4d126edc3fb2bc426a717e2dba", "signature_version": "v1" }, { "signature_type": "Line", "target": { "file": "net/ipv4/tcp_bpf.c" }, "id": "CVE-2022-49877-403ede3d", "digest": { "threshold": 0.9, "line_hashes": [ "338352325597435347278241066696200919223", "246083510908893579800564240639570978436", "15395900642727071898471772858254928957", "122444381739873649539453762819172023376", "313035688218683426997228959942232517431", "302397780437361726800801161575571250535", "164054985833141694862345695013719780480", "269871910855767794164489005584346280993", "243152460422984257875219427450558718222", "184216578486179968444689350482295485303", "287572689086656306498470726788191207956", "221698516999581583581102051653443036796", "311357693874183682634497074065317740752", "140423321907225773417057246523432953665" ] }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ec95b94716a1e4d126edc3fb2bc426a717e2dba", "signature_version": "v1" }, { "signature_type": "Line", "target": { "file": "net/ipv4/tcp_bpf.c" }, "id": "CVE-2022-49877-4da25abf", "digest": { "threshold": 0.9, "line_hashes": [ "338352325597435347278241066696200919223", "246083510908893579800564240639570978436", "15395900642727071898471772858254928957", "122444381739873649539453762819172023376", "313035688218683426997228959942232517431", "302397780437361726800801161575571250535", "164054985833141694862345695013719780480", "269871910855767794164489005584346280993", "243152460422984257875219427450558718222", "184216578486179968444689350482295485303", "287572689086656306498470726788191207956", "221698516999581583581102051653443036796", "311357693874183682634497074065317740752", "140423321907225773417057246523432953665" ] }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@14e8bc3bf7bd6af64d7538a0684c8238d96cdfd7", "signature_version": "v1" }, { "signature_type": "Line", "target": { "file": "net/ipv4/tcp_bpf.c" }, "id": "CVE-2022-49877-4f3d3e94", "digest": { "threshold": 0.9, "line_hashes": [ "338352325597435347278241066696200919223", "246083510908893579800564240639570978436", "15395900642727071898471772858254928957", "122444381739873649539453762819172023376", "313035688218683426997228959942232517431", "302397780437361726800801161575571250535", "164054985833141694862345695013719780480", "269871910855767794164489005584346280993", "243152460422984257875219427450558718222", "184216578486179968444689350482295485303", "287572689086656306498470726788191207956", "221698516999581583581102051653443036796", "311357693874183682634497074065317740752", "140423321907225773417057246523432953665" ] }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cc21dc48a78cc9e5af9a4d039cd456446a6e73ff", "signature_version": "v1" }, { "signature_type": "Line", "target": { "file": "net/ipv4/tcp_bpf.c" }, "id": "CVE-2022-49877-619d51d9", "digest": { "threshold": 0.9, "line_hashes": [ "338352325597435347278241066696200919223", "246083510908893579800564240639570978436", "15395900642727071898471772858254928957", "122444381739873649539453762819172023376", "313035688218683426997228959942232517431", "302397780437361726800801161575571250535", "164054985833141694862345695013719780480", "269871910855767794164489005584346280993", "243152460422984257875219427450558718222", "184216578486179968444689350482295485303", "287572689086656306498470726788191207956", "221698516999581583581102051653443036796", "311357693874183682634497074065317740752", "140423321907225773417057246523432953665" ] }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d975bec1eaeb52341acc9273db79ddb078220399", "signature_version": "v1" }, { "signature_type": "Function", "target": { "file": "net/ipv4/tcp_bpf.c", "function": "tcp_bpf_send_verdict" }, "id": "CVE-2022-49877-c4c74083", "digest": { "length": 2221.0, "function_hash": "36804321464058055607092261351928444047" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@95adbd2ac8de82e43fd6b347e7e1b47f74dc1abb", "signature_version": "v1" }, { "signature_type": "Line", "target": { "file": "net/ipv4/tcp_bpf.c" }, "id": "CVE-2022-49877-ffe70d1b", "digest": { "threshold": 0.9, "line_hashes": [ "338352325597435347278241066696200919223", "246083510908893579800564240639570978436", "15395900642727071898471772858254928957", "122444381739873649539453762819172023376", "313035688218683426997228959942232517431", "302397780437361726800801161575571250535", "164054985833141694862345695013719780480", "269871910855767794164489005584346280993", "243152460422984257875219427450558718222", "184216578486179968444689350482295485303", "287572689086656306498470726788191207956", "221698516999581583581102051653443036796", "311357693874183682634497074065317740752", "140423321907225773417057246523432953665" ] }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@95adbd2ac8de82e43fd6b347e7e1b47f74dc1abb", "signature_version": "v1" } ] }