In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: Fix more uncharged while msg has more_data
In tcpbpfsendverdict(), if msg has more data after tcpbpfsendmsgredir():
tcpbpfsendverdict() tosend = msg->sg.size //msg->sg.size = 22220 case _SKREDIRECT: skmsgreturn() //uncharged msg->sg.size(22220) sk->skforwardalloc tcpbpfsendmsgredir() //after tcpbpfsendmsgredir, msg->sg.size=11000 goto moredata; tosend = msg->sg.size //msg->sg.size = 11000 case _SKREDIRECT: skmsgreturn() //uncharged msg->sg.size(11000) to sk->skforwardalloc
The msg->sg.size(11000) has been uncharged twice, to fix we can charge the remaining msg->sg.size before goto more data.
This issue can cause the following info: WARNING: CPU: 0 PID: 9860 at net/core/stream.c:208 skstreamkillqueues+0xd4/0x1a0 Call Trace: <TASK> inetcskdestroysock+0x55/0x110 _tcpclose+0x279/0x470 tcpclose+0x1f/0x60 inetrelease+0x3f/0x80 _sockrelease+0x3d/0xb0 sockclose+0x11/0x20 _fput+0x92/0x250 taskworkrun+0x6a/0xa0 doexit+0x33b/0xb60 dogroupexit+0x2f/0xa0 getsignal+0xb6/0x950 archdosignalorrestart+0xac/0x2a0 ? vfswrite+0x237/0x290 exittousermodeprepare+0xa9/0x200 syscallexittousermode+0x12/0x30 dosyscall64+0x46/0x80 entrySYSCALL64after_hwframe+0x44/0xae </TASK>
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>
[
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_send_verdict"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@244ce90c8d0bd10ebf957da02c6f3fcd5d920bdf",
"digest": {
"length": 2132.0,
"function_hash": "229448887702766848885734677011967823108"
},
"id": "CVE-2022-49204-1c93587f"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@244ce90c8d0bd10ebf957da02c6f3fcd5d920bdf",
"digest": {
"line_hashes": [
"327235427596413112517313287111988439607",
"231272158419658695425360283347984866506",
"298662817480939789920736314342822512719",
"65575849328194190191281653255274811641",
"116711773019349685572723791607853051003",
"233239502275863722379302963457483672049",
"209767301248364106010279531573515021990",
"291412355491965905367087731121096336111",
"54977392969421193818345844328871590706"
],
"threshold": 0.9
},
"id": "CVE-2022-49204-1efc6a30"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_send_verdict"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@abb4caa477a5450817d2aa1198edce66450aecf8",
"digest": {
"length": 2132.0,
"function_hash": "229448887702766848885734677011967823108"
},
"id": "CVE-2022-49204-507843fd"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_send_verdict"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@168ff181f5b6e7fce684c98a30d35da1dbf8f82a",
"digest": {
"length": 2132.0,
"function_hash": "229448887702766848885734677011967823108"
},
"id": "CVE-2022-49204-77ff191f"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b812a369e6416ab06d83cdd39d8e3f752781dd0",
"digest": {
"line_hashes": [
"327235427596413112517313287111988439607",
"231272158419658695425360283347984866506",
"298662817480939789920736314342822512719",
"65575849328194190191281653255274811641",
"116711773019349685572723791607853051003",
"233239502275863722379302963457483672049",
"209767301248364106010279531573515021990",
"291412355491965905367087731121096336111",
"54977392969421193818345844328871590706"
],
"threshold": 0.9
},
"id": "CVE-2022-49204-7dd4fd6d"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@87d532d41ef937e16f61b3d2094f3a2ac49be365",
"digest": {
"line_hashes": [
"327235427596413112517313287111988439607",
"231272158419658695425360283347984866506",
"298662817480939789920736314342822512719",
"65575849328194190191281653255274811641",
"116711773019349685572723791607853051003",
"233239502275863722379302963457483672049",
"209767301248364106010279531573515021990",
"291412355491965905367087731121096336111",
"54977392969421193818345844328871590706"
],
"threshold": 0.9
},
"id": "CVE-2022-49204-949b3478"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@168ff181f5b6e7fce684c98a30d35da1dbf8f82a",
"digest": {
"line_hashes": [
"327235427596413112517313287111988439607",
"231272158419658695425360283347984866506",
"298662817480939789920736314342822512719",
"65575849328194190191281653255274811641",
"116711773019349685572723791607853051003",
"233239502275863722379302963457483672049",
"209767301248364106010279531573515021990",
"291412355491965905367087731121096336111",
"54977392969421193818345844328871590706"
],
"threshold": 0.9
},
"id": "CVE-2022-49204-aee962ad"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_send_verdict"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b812a369e6416ab06d83cdd39d8e3f752781dd0",
"digest": {
"length": 2132.0,
"function_hash": "229448887702766848885734677011967823108"
},
"id": "CVE-2022-49204-ca6dcc14"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_send_verdict"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@87d532d41ef937e16f61b3d2094f3a2ac49be365",
"digest": {
"length": 2132.0,
"function_hash": "229448887702766848885734677011967823108"
},
"id": "CVE-2022-49204-d266495f"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_send_verdict"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@84472b436e760ba439e1969a9e3c5ae7c86de39d",
"digest": {
"length": 2132.0,
"function_hash": "229448887702766848885734677011967823108"
},
"id": "CVE-2022-49204-e24f2576"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@abb4caa477a5450817d2aa1198edce66450aecf8",
"digest": {
"line_hashes": [
"327235427596413112517313287111988439607",
"231272158419658695425360283347984866506",
"298662817480939789920736314342822512719",
"65575849328194190191281653255274811641",
"116711773019349685572723791607853051003",
"233239502275863722379302963457483672049",
"209767301248364106010279531573515021990",
"291412355491965905367087731121096336111",
"54977392969421193818345844328871590706"
],
"threshold": 0.9
},
"id": "CVE-2022-49204-f4f5878b"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@84472b436e760ba439e1969a9e3c5ae7c86de39d",
"digest": {
"line_hashes": [
"327235427596413112517313287111988439607",
"231272158419658695425360283347984866506",
"298662817480939789920736314342822512719",
"65575849328194190191281653255274811641",
"116711773019349685572723791607853051003",
"233239502275863722379302963457483672049",
"209767301248364106010279531573515021990",
"291412355491965905367087731121096336111",
"54977392969421193818345844328871590706"
],
"threshold": 0.9
},
"id": "CVE-2022-49204-fafbc814"
}
]