In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: Fix repeated calls to sockput() when msg has moredata
In tcpbpfsendverdict() redirection, the eval variable is assigned to _SKREDIRECT after the applybytes data is sent, if msg has moredata, sockput() will be called multiple times.
We should reset the eval variable to _SKNONE every time more_data starts.
This causes:
IPv4: Attempt to release TCP socket in state 1 00000000b4c925d7 ------------[ cut here ]------------ refcountt: addition on 0; use-after-free. WARNING: CPU: 5 PID: 4482 at lib/refcount.c:25 refcountwarnsaturate+0x7d/0x110 Modules linked in: CPU: 5 PID: 4482 Comm: sockhashbypass Kdump: loaded Not tainted 6.0.0 #1 Hardware name: Red Hat KVM, BIOS 1.11.0-2.el7 04/01/2014 Call Trace: <TASK> _tcptransmitskb+0xa1b/0xb90 ? _allocskb+0x8c/0x1a0 ? _kmallocnodetrackcaller+0x184/0x320 tcpwritexmit+0x22a/0x1110 _tcppushpendingframes+0x32/0xf0 dotcpsendpages+0x62d/0x640 tcpbpfpush+0xae/0x2c0 tcpbpfsendmsgredir+0x260/0x410 ? preemptcountadd+0x70/0xa0 tcpbpfsendverdict+0x386/0x4b0 tcpbpfsendmsg+0x21b/0x3b0 socksendmsg+0x58/0x70 _syssendto+0xfa/0x170 ? xfdvalidatestate+0x1d/0x80 ? switchfpureturn+0x59/0xe0 _x64syssendto+0x24/0x30 dosyscall64+0x37/0x90 entrySYSCALL64after_hwframe+0x63/0xcd
[
{
"id": "CVE-2022-50536-093a586e",
"signature_type": "Function",
"signature_version": "v1",
"digest": {
"length": 2269.0,
"function_hash": "227179251128928468181187403652965074766"
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8786bde11a4f31b63b3036731df0b47337a7a245",
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-27af8149",
"signature_type": "Function",
"signature_version": "v1",
"digest": {
"length": 2269.0,
"function_hash": "227179251128928468181187403652965074766"
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7a9841ca025275b5b0edfb0b618934abb6ceec15",
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-4ba37418",
"signature_type": "Line",
"signature_version": "v1",
"digest": {
"line_hashes": [
"231442888013508877110166308831394268412",
"49207106139116242840276668057783690563",
"71130322968961258817227048450427232813",
"256555953413687318015003629396191364417",
"190939736836017390446859383745012128344",
"242358900872129683632299179981161422631",
"271089321986012775563018910691000913807",
"274378579494893707615829041019029457618"
],
"threshold": 0.9
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@28e4a763cd4a2b1a78852216ef4bd7df3a05cec6",
"target": {
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-4d9cbf29",
"signature_type": "Function",
"signature_version": "v1",
"digest": {
"length": 2269.0,
"function_hash": "227179251128928468181187403652965074766"
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@113236e8f49f262f318c00ebb14b15f4834e87c1",
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-4e555b49",
"signature_type": "Line",
"signature_version": "v1",
"digest": {
"line_hashes": [
"231442888013508877110166308831394268412",
"49207106139116242840276668057783690563",
"71130322968961258817227048450427232813",
"256555953413687318015003629396191364417",
"190939736836017390446859383745012128344",
"242358900872129683632299179981161422631",
"271089321986012775563018910691000913807",
"274378579494893707615829041019029457618"
],
"threshold": 0.9
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8786bde11a4f31b63b3036731df0b47337a7a245",
"target": {
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-58f27bb6",
"signature_type": "Line",
"signature_version": "v1",
"digest": {
"line_hashes": [
"231442888013508877110166308831394268412",
"49207106139116242840276668057783690563",
"71130322968961258817227048450427232813",
"256555953413687318015003629396191364417",
"190939736836017390446859383745012128344",
"242358900872129683632299179981161422631",
"271089321986012775563018910691000913807",
"274378579494893707615829041019029457618"
],
"threshold": 0.9
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@578a7628b838a3ac8ad61deaab5a816ff032ac13",
"target": {
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-ba81ff41",
"signature_type": "Line",
"signature_version": "v1",
"digest": {
"line_hashes": [
"231442888013508877110166308831394268412",
"49207106139116242840276668057783690563",
"71130322968961258817227048450427232813",
"256555953413687318015003629396191364417",
"190939736836017390446859383745012128344",
"242358900872129683632299179981161422631",
"271089321986012775563018910691000913807",
"274378579494893707615829041019029457618"
],
"threshold": 0.9
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7508b9f4daac4ec7dfe0b6fb2d688b1c1c105e10",
"target": {
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-bbc8d9fc",
"signature_type": "Function",
"signature_version": "v1",
"digest": {
"length": 2269.0,
"function_hash": "227179251128928468181187403652965074766"
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7508b9f4daac4ec7dfe0b6fb2d688b1c1c105e10",
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-bfe83b0a",
"signature_type": "Line",
"signature_version": "v1",
"digest": {
"line_hashes": [
"231442888013508877110166308831394268412",
"49207106139116242840276668057783690563",
"71130322968961258817227048450427232813",
"256555953413687318015003629396191364417",
"190939736836017390446859383745012128344",
"242358900872129683632299179981161422631",
"271089321986012775563018910691000913807",
"274378579494893707615829041019029457618"
],
"threshold": 0.9
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@113236e8f49f262f318c00ebb14b15f4834e87c1",
"target": {
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-d90b291c",
"signature_type": "Function",
"signature_version": "v1",
"digest": {
"length": 2269.0,
"function_hash": "227179251128928468181187403652965074766"
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@28e4a763cd4a2b1a78852216ef4bd7df3a05cec6",
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-ea307ae8",
"signature_type": "Function",
"signature_version": "v1",
"digest": {
"length": 2269.0,
"function_hash": "227179251128928468181187403652965074766"
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@578a7628b838a3ac8ad61deaab5a816ff032ac13",
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
}
},
{
"id": "CVE-2022-50536-edf0248b",
"signature_type": "Line",
"signature_version": "v1",
"digest": {
"line_hashes": [
"231442888013508877110166308831394268412",
"49207106139116242840276668057783690563",
"71130322968961258817227048450427232813",
"256555953413687318015003629396191364417",
"190939736836017390446859383745012128344",
"242358900872129683632299179981161422631",
"271089321986012775563018910691000913807",
"274378579494893707615829041019029457618"
],
"threshold": 0.9
},
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7a9841ca025275b5b0edfb0b618934abb6ceec15",
"target": {
"file": "net/ipv4/tcp_bpf.c"
}
}
]