In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: Fix an infinite loop error when len is 0 in tcpbpfrecvmsg_parser()
When the buffer length of the recvmsg system call is 0, we got the flollowing soft lockup problem:
watchdog: BUG: soft lockup - CPU#3 stuck for 27s! [a.out:6149] CPU: 3 PID: 6149 Comm: a.out Kdump: loaded Not tainted 6.2.0+ #30 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014 RIP: 0010:removewaitqueue+0xb/0xc0 Code: 5e 41 5f c3 cc cc cc cc 0f 1f 80 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 1f 44 00 00 41 57 <41> 56 41 55 41 54 55 48 89 fd 53 48 89 f3 4c 8d 6b 18 4c 8d 73 20 RSP: 0018:ffff88811b5978b8 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff88811a7d3780 RCX: ffffffffb7a4d768 RDX: dffffc0000000000 RSI: ffff88811b597908 RDI: ffff888115408040 RBP: 1ffff110236b2f1b R08: 0000000000000000 R09: ffff88811a7d37e7 R10: ffffed10234fa6fc R11: 0000000000000001 R12: ffff88811179b800 R13: 0000000000000001 R14: ffff88811a7d38a8 R15: ffff88811a7d37e0 FS: 00007f6fb5398740(0000) GS:ffff888237180000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000000 CR3: 000000010b6ba002 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> tcpmsgwaitdata+0x279/0x2f0 tcpbpfrecvmsgparser+0x3c6/0x490 inetrecvmsg+0x280/0x290 sockrecvmsg+0xfc/0x120 _sysrecvmsg+0x160/0x3d0 sysrecvmsg+0xf0/0x180 _sysrecvmsg+0xea/0x1a0 dosyscall64+0x3f/0x90 entrySYSCALL64afterhwframe+0x72/0xdc
The logic in tcpbpfrecvmsg_parser is as follows:
msgbytesready: copied = skmsgrecvmsg(sk, psock, msg, len, flags); if (!copied) { wait data; goto msgbytesready; }
In this case, "copied" always is 0, the infinite loop occurs.
According to the Linux system call man page, 0 should be returned in this case. Therefore, in tcpbpfrecvmsg_parser(), if the length is 0, directly return. Also modify several other functions with the same problem.
[
{
"id": "CVE-2023-53133-1b8a7341",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45cf3ae3068e70e2c7f3e24a7f8e8aa99511f03",
"signature_type": "Line",
"digest": {
"line_hashes": [
"119348215406133859418116062704674202253",
"248242197927243952981694504725271913650",
"88317464986688606779843997016444049453",
"2469246664104793938131416359256952415",
"248242197927243952981694504725271913650",
"88317464986688606779843997016444049453"
],
"threshold": 0.9
}
},
{
"id": "CVE-2023-53133-201119f4",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf0579989de64d36e177c0611c685dc4a91457a7",
"signature_type": "Function",
"digest": {
"length": 990.0,
"function_hash": "206788411346960780601354895297914592559"
}
},
{
"id": "CVE-2023-53133-2a9752bf",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/udp_bpf.c",
"function": "udp_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d900f3d20cc3169ce42ec72acc850e662a4d4db2",
"signature_type": "Function",
"digest": {
"length": 853.0,
"function_hash": "238163351252264516394050142086350372753"
}
},
{
"id": "CVE-2023-53133-38c8db77",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/unix/unix_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45cf3ae3068e70e2c7f3e24a7f8e8aa99511f03",
"signature_type": "Line",
"digest": {
"line_hashes": [
"270026086286472646038916042462540980835",
"147034645154321740165290866314761591992",
"645763165599479276005444783540521470"
],
"threshold": 0.9
}
},
{
"id": "CVE-2023-53133-3c7ceae1",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/udp_bpf.c",
"function": "udp_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45cf3ae3068e70e2c7f3e24a7f8e8aa99511f03",
"signature_type": "Function",
"digest": {
"length": 853.0,
"function_hash": "238163351252264516394050142086350372753"
}
},
{
"id": "CVE-2023-53133-3dcac149",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d900f3d20cc3169ce42ec72acc850e662a4d4db2",
"signature_type": "Function",
"digest": {
"length": 990.0,
"function_hash": "206788411346960780601354895297914592559"
}
},
{
"id": "CVE-2023-53133-420092de",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_recvmsg_parser"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45cf3ae3068e70e2c7f3e24a7f8e8aa99511f03",
"signature_type": "Function",
"digest": {
"length": 1054.0,
"function_hash": "11441715296483397234669763624517268465"
}
},
{
"id": "CVE-2023-53133-5757f451",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d900f3d20cc3169ce42ec72acc850e662a4d4db2",
"signature_type": "Line",
"digest": {
"line_hashes": [
"119348215406133859418116062704674202253",
"248242197927243952981694504725271913650",
"88317464986688606779843997016444049453",
"2469246664104793938131416359256952415",
"248242197927243952981694504725271913650",
"88317464986688606779843997016444049453"
],
"threshold": 0.9
}
},
{
"id": "CVE-2023-53133-61a24392",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/udp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45cf3ae3068e70e2c7f3e24a7f8e8aa99511f03",
"signature_type": "Line",
"digest": {
"line_hashes": [
"2469246664104793938131416359256952415",
"248242197927243952981694504725271913650",
"72769051735560905175768918780850280006"
],
"threshold": 0.9
}
},
{
"id": "CVE-2023-53133-674f57c5",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45cf3ae3068e70e2c7f3e24a7f8e8aa99511f03",
"signature_type": "Function",
"digest": {
"length": 990.0,
"function_hash": "206788411346960780601354895297914592559"
}
},
{
"id": "CVE-2023-53133-6a541f35",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/udp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d900f3d20cc3169ce42ec72acc850e662a4d4db2",
"signature_type": "Line",
"digest": {
"line_hashes": [
"2469246664104793938131416359256952415",
"248242197927243952981694504725271913650",
"72769051735560905175768918780850280006"
],
"threshold": 0.9
}
},
{
"id": "CVE-2023-53133-73bb0521",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf0579989de64d36e177c0611c685dc4a91457a7",
"signature_type": "Line",
"digest": {
"line_hashes": [
"119348215406133859418116062704674202253",
"248242197927243952981694504725271913650",
"88317464986688606779843997016444049453",
"2469246664104793938131416359256952415",
"248242197927243952981694504725271913650",
"88317464986688606779843997016444049453"
],
"threshold": 0.9
}
},
{
"id": "CVE-2023-53133-9933cbb3",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_recvmsg_parser"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf0579989de64d36e177c0611c685dc4a91457a7",
"signature_type": "Function",
"digest": {
"length": 1054.0,
"function_hash": "11441715296483397234669763624517268465"
}
},
{
"id": "CVE-2023-53133-9cba7793",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/unix/unix_bpf.c",
"function": "unix_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45cf3ae3068e70e2c7f3e24a7f8e8aa99511f03",
"signature_type": "Function",
"digest": {
"length": 951.0,
"function_hash": "187032837152796223097998284553928440238"
}
},
{
"id": "CVE-2023-53133-ae5f242e",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/unix/unix_bpf.c",
"function": "unix_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d900f3d20cc3169ce42ec72acc850e662a4d4db2",
"signature_type": "Function",
"digest": {
"length": 951.0,
"function_hash": "187032837152796223097998284553928440238"
}
},
{
"id": "CVE-2023-53133-c1de526f",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/udp_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf0579989de64d36e177c0611c685dc4a91457a7",
"signature_type": "Line",
"digest": {
"line_hashes": [
"2469246664104793938131416359256952415",
"248242197927243952981694504725271913650",
"72769051735560905175768918780850280006"
],
"threshold": 0.9
}
},
{
"id": "CVE-2023-53133-c56f0733",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/unix/unix_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf0579989de64d36e177c0611c685dc4a91457a7",
"signature_type": "Line",
"digest": {
"line_hashes": [
"270026086286472646038916042462540980835",
"147034645154321740165290866314761591992",
"645763165599479276005444783540521470"
],
"threshold": 0.9
}
},
{
"id": "CVE-2023-53133-da07c90f",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/unix/unix_bpf.c",
"function": "unix_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf0579989de64d36e177c0611c685dc4a91457a7",
"signature_type": "Function",
"digest": {
"length": 951.0,
"function_hash": "187032837152796223097998284553928440238"
}
},
{
"id": "CVE-2023-53133-dbfd2489",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/udp_bpf.c",
"function": "udp_bpf_recvmsg"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf0579989de64d36e177c0611c685dc4a91457a7",
"signature_type": "Function",
"digest": {
"length": 853.0,
"function_hash": "238163351252264516394050142086350372753"
}
},
{
"id": "CVE-2023-53133-e5a0d59f",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c",
"function": "tcp_bpf_recvmsg_parser"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d900f3d20cc3169ce42ec72acc850e662a4d4db2",
"signature_type": "Function",
"digest": {
"length": 1054.0,
"function_hash": "11441715296483397234669763624517268465"
}
},
{
"id": "CVE-2023-53133-fbcce283",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "net/unix/unix_bpf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d900f3d20cc3169ce42ec72acc850e662a4d4db2",
"signature_type": "Line",
"digest": {
"line_hashes": [
"270026086286472646038916042462540980835",
"147034645154321740165290866314761591992",
"645763165599479276005444783540521470"
],
"threshold": 0.9
}
}
]