In the Linux kernel, the following vulnerability has been resolved:
xdp: Remove WARN() from _xdpregmemmodel()
syzkaller reports a warning in _xdpregmemmodel().
The warning occurs only if _memidinithash_table() returns an error. It returns the error in two cases:
The second case cannot happen since there is a static const rhashtable_params struct with valid fields. So, warning is only triggered when there is a problem with memory allocation.
Thus, there is no sense in using WARN() to handle this error and it can be safely removed.
WARNING: CPU: 0 PID: 5065 at net/core/xdp.c:299 _xdpregmemmodel+0x2d9/0x650 net/core/xdp.c:299
CPU: 0 PID: 5065 Comm: syz-executor883 Not tainted 6.8.0-syzkaller-05271-gf99c5f563c17 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 RIP: 0010:_xdpregmemmodel+0x2d9/0x650 net/core/xdp.c:299
Call Trace: xdpregmemmodel+0x22/0x40 net/core/xdp.c:344 xdptestrunsetup net/bpf/testrun.c:188 [inline] bpftestrunxdplive+0x365/0x1e90 net/bpf/testrun.c:377 bpfprogtestrunxdp+0x813/0x11b0 net/bpf/testrun.c:1267 bpfprogtestrun+0x33a/0x3b0 kernel/bpf/syscall.c:4240 _sysbpf+0x48d/0x810 kernel/bpf/syscall.c:5649 _dosysbpf kernel/bpf/syscall.c:5738 [inline] _sesysbpf kernel/bpf/syscall.c:5736 [inline] _x64sysbpf+0x7c/0x90 kernel/bpf/syscall.c:5736 dosyscall64+0xfb/0x240 entrySYSCALL64after_hwframe+0x6d/0x75
Found by Linux Verification Center (linuxtesting.org) with syzkaller.
[
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1153.0,
"function_hash": "330830949504030142859864023968190127216"
},
"target": {
"file": "net/core/xdp.c",
"function": "__xdp_reg_mem_model"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7e9f79428372c6eab92271390851be34ab26bfb4",
"signature_version": "v1",
"id": "CVE-2024-42082-07983171"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"82390807069788503397390560846979306276",
"329509840067212386023431402528519206709",
"41352196095200882819738499783073023274",
"319516003551657541329093731405968716783",
"74965148444625899831139197021338488517",
"336584476280793170355747955238607470737",
"118791332268869073068620685510886471277"
],
"threshold": 0.9
},
"target": {
"file": "net/core/xdp.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@14e51ea78b4ccacb7acb1346b9241bb790a2054c",
"signature_version": "v1",
"id": "CVE-2024-42082-0d49aec3"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1153.0,
"function_hash": "330830949504030142859864023968190127216"
},
"target": {
"file": "net/core/xdp.c",
"function": "__xdp_reg_mem_model"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@14e51ea78b4ccacb7acb1346b9241bb790a2054c",
"signature_version": "v1",
"id": "CVE-2024-42082-25987dfe"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1145.0,
"function_hash": "192630799164770741602603925138699194424"
},
"target": {
"file": "net/core/xdp.c",
"function": "__xdp_reg_mem_model"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d3e3b3aa2cbe9bc7db9a7f8673a9fa6d2990d54",
"signature_version": "v1",
"id": "CVE-2024-42082-2801cdfa"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"82390807069788503397390560846979306276",
"329509840067212386023431402528519206709",
"41352196095200882819738499783073023274",
"319516003551657541329093731405968716783",
"74965148444625899831139197021338488517",
"336584476280793170355747955238607470737",
"118791332268869073068620685510886471277"
],
"threshold": 0.9
},
"target": {
"file": "net/core/xdp.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1095b8efbb13a6a5fa583ed373ee1ccab29da2d0",
"signature_version": "v1",
"id": "CVE-2024-42082-3f166f99"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"82390807069788503397390560846979306276",
"329509840067212386023431402528519206709",
"41352196095200882819738499783073023274",
"319516003551657541329093731405968716783",
"74965148444625899831139197021338488517",
"336584476280793170355747955238607470737",
"118791332268869073068620685510886471277"
],
"threshold": 0.9
},
"target": {
"file": "net/core/xdp.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4e0c539ee265d5c6e7fa7d229cd4aa7bc01816e2",
"signature_version": "v1",
"id": "CVE-2024-42082-b082896f"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1153.0,
"function_hash": "330830949504030142859864023968190127216"
},
"target": {
"file": "net/core/xdp.c",
"function": "__xdp_reg_mem_model"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4e0c539ee265d5c6e7fa7d229cd4aa7bc01816e2",
"signature_version": "v1",
"id": "CVE-2024-42082-cf2de724"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1145.0,
"function_hash": "192630799164770741602603925138699194424"
},
"target": {
"file": "net/core/xdp.c",
"function": "__xdp_reg_mem_model"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1095b8efbb13a6a5fa583ed373ee1ccab29da2d0",
"signature_version": "v1",
"id": "CVE-2024-42082-d08fd0c3"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"82390807069788503397390560846979306276",
"329509840067212386023431402528519206709",
"41352196095200882819738499783073023274",
"319516003551657541329093731405968716783",
"74965148444625899831139197021338488517",
"336584476280793170355747955238607470737",
"118791332268869073068620685510886471277"
],
"threshold": 0.9
},
"target": {
"file": "net/core/xdp.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7e9f79428372c6eab92271390851be34ab26bfb4",
"signature_version": "v1",
"id": "CVE-2024-42082-d0cecd37"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"82390807069788503397390560846979306276",
"329509840067212386023431402528519206709",
"41352196095200882819738499783073023274",
"319516003551657541329093731405968716783",
"74965148444625899831139197021338488517",
"336584476280793170355747955238607470737",
"118791332268869073068620685510886471277"
],
"threshold": 0.9
},
"target": {
"file": "net/core/xdp.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d3e3b3aa2cbe9bc7db9a7f8673a9fa6d2990d54",
"signature_version": "v1",
"id": "CVE-2024-42082-fc2aa53f"
}
]