{
  "id": "CVE-2025-21867",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-21867",
  "published_at": "2025-03-27T13:38:20.673Z",
  "title": "bpf, test_run: Fix use-after-free issue in eth_skb_pkt_type()",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cisa-adp",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, test_run: Fix use-after-free issue in eth_skb_pkt_type()\n\nKMSAN reported a use-after-free issue in eth_skb_pkt_type()[1]. The\ncause of the issue was that eth_skb_pkt_type() accessed skb's data\nthat didn't contain an Ethernet header. This occurs when\nbpf_prog_test_run_xdp() passes an invalid value as the user_data\nargument to bpf_test_init().\n\nFix this by returning an error when user_data is less than ETH_HLEN in\nbpf_test_init(). Additionally, remove the check for \"if (user_size \u003e\nsize)\" as it is unnecessary.\n\n[1]\nBUG: KMSAN: use-after-free in eth_skb_pkt_type include/linux/etherdevice.h:627 [inline]\nBUG: KMSAN: use-after-free in eth_type_trans+0x4ee/0x980 net/ethernet/eth.c:165\n eth_skb_pkt_type include/linux/etherdevice.h:627 [inline]\n eth_type_trans+0x4ee/0x980 net/ethernet/eth.c:165\n __xdp_build_skb_from_frame+0x5a8/0xa50 net/core/xdp.c:635\n xdp_recv_frames net/bpf/test_run.c:272 [inline]\n xdp_test_run_batch net/bpf/test_run.c:361 [inline]\n bpf_test_run_xdp_live+0x2954/0x3330 net/bpf/test_run.c:390\n bpf_prog_test_run_xdp+0x148e/0x1b10 net/bpf/test_run.c:1318\n bpf_prog_test_run+0x5b7/0xa30 kernel/bpf/syscall.c:4371\n __sys_bpf+0x6a6/0xe20 kernel/bpf/syscall.c:5777\n __do_sys_bpf kernel/bpf/syscall.c:5866 [inline]\n __se_sys_bpf kernel/bpf/syscall.c:5864 [inline]\n __x64_sys_bpf+0xa4/0xf0 kernel/bpf/syscall.c:5864\n x64_sys_call+0x2ea0/0x3d90 arch/x86/include/generated/asm/syscalls_64.h:322\n do_syscall_x64 arch/x86/entry/common.c:52 [inline]\n do_syscall_64+0xd9/0x1d0 arch/x86/entry/common.c:83\n entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\nUninit was created at:\n free_pages_prepare mm/page_alloc.c:1056 [inline]\n free_unref_page+0x156/0x1320 mm/page_alloc.c:2657\n __free_pages+0xa3/0x1b0 mm/page_alloc.c:4838\n bpf_ringbuf_free kernel/bpf/ringbuf.c:226 [inline]\n ringbuf_map_free+0xff/0x1e0 kernel/bpf/ringbuf.c:235\n bpf_map_free kernel/bpf/syscall.c:838 [inline]\n bpf_map_free_deferred+0x17c/0x310 kernel/bpf/syscall.c:862\n process_one_work kernel/workqueue.c:3229 [inline]\n process_scheduled_works+0xa2b/0x1b60 kernel/workqueue.c:3310\n worker_thread+0xedf/0x1550 kernel/workqueue.c:3391\n kthread+0x535/0x6b0 kernel/kthread.c:389\n ret_from_fork+0x6e/0x90 arch/x86/kernel/process.c:147\n ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244\n\nCPU: 1 UID: 0 PID: 17276 Comm: syz.1.16450 Not tainted 6.12.0-05490-g9bb88c659673 #8\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-3.fc41 04/01/2014",
  "cwe": "CWE-416",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.14:rc2:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.14:rc3:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cisa-adp": 7.8,
    "cna": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= be3d72a2896cb24090f268dce4aa8a304d40bc23, \u003c f615fccfc689cb48977d275ac2e391297b52392b",
          "\u003e= be3d72a2896cb24090f268dce4aa8a304d40bc23, \u003c d56d8a23d95100b65f40438639dd82db2af81c11",
          "\u003e= be3d72a2896cb24090f268dce4aa8a304d40bc23, \u003c 972bafed67ca73ad9a56448384281eb5fd5c0ba3",
          "\u003e= be3d72a2896cb24090f268dce4aa8a304d40bc23, \u003c 1a9e1284e87d59b1303b69d1808d310821d6e5f7",
          "\u003e= be3d72a2896cb24090f268dce4aa8a304d40bc23, \u003c 6b3d638ca897e099fa99bd6d02189d3176f80a47"
        ],
        "fixed_in": [
          "f615fccfc689cb48977d275ac2e391297b52392b",
          "d56d8a23d95100b65f40438639dd82db2af81c11",
          "972bafed67ca73ad9a56448384281eb5fd5c0ba3",
          "1a9e1284e87d59b1303b69d1808d310821d6e5f7",
          "6b3d638ca897e099fa99bd6d02189d3176f80a47"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "5.18"
        ],
        "fixed_in": [
          "0",
          "6.1.130",
          "6.6.80",
          "6.12.17",
          "6.13.5",
          "6.14"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to f615fccfc689cb48977d275ac2e391297b52392b or d56d8a23d95100b65f40438639dd82db2af81c11 or 972bafed67ca73ad9a56448384281eb5fd5c0ba3 or 1a9e1284e87d59b1303b69d1808d310821d6e5f7 or 6b3d638ca897e099fa99bd6d02189d3176f80a47 or later.",
      "Upgrade Linux to 0 or 6.1.130 or 6.6.80 or 6.12.17 or 6.13.5 or 6.14 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
