ghsa-p39f-f66f-x437
Vulnerability from github
Published
2025-05-01 15:31
Modified
2025-05-01 15:31
Details

In the Linux kernel, the following vulnerability has been resolved:

bpf, verifier: Fix memory leak in array reallocation for stack state

If an error (NULL) is returned by krealloc(), callers of realloc_array() were setting their allocation pointers to NULL, but on error krealloc() does not touch the original allocation. This would result in a memory resource leak. Instead, free the old allocation on the error handling path.

The memory leak information is as follows as also reported by Zhengchao:

unreferenced object 0xffff888019801800 (size 256): comm "bpf_repo", pid 6490, jiffies 4294959200 (age 17.170s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000b211474b>] __kmalloc_node_track_caller+0x45/0xc0 [<0000000086712a0b>] krealloc+0x83/0xd0 [<00000000139aab02>] realloc_array+0x82/0xe2 [<00000000b1ca41d1>] grow_stack_state+0xfb/0x186 [<00000000cd6f36d2>] check_mem_access.cold+0x141/0x1341 [<0000000081780455>] do_check_common+0x5358/0xb350 [<0000000015f6b091>] bpf_check.cold+0xc3/0x29d [<000000002973c690>] bpf_prog_load+0x13db/0x2240 [<00000000028d1644>] __sys_bpf+0x1605/0x4ce0 [<00000000053f29bd>] __x64_sys_bpf+0x75/0xb0 [<0000000056fedaf5>] do_syscall_64+0x35/0x80 [<000000002bd58261>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

Show details on source website


{
  "affected": [],
  "aliases": [
    "CVE-2022-49878"
  ],
  "database_specific": {
    "cwe_ids": [],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-05-01T15:16:12Z",
    "severity": null
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, verifier: Fix memory leak in array reallocation for stack state\n\nIf an error (NULL) is returned by krealloc(), callers of realloc_array()\nwere setting their allocation pointers to NULL, but on error krealloc()\ndoes not touch the original allocation. This would result in a memory\nresource leak. Instead, free the old allocation on the error handling\npath.\n\nThe memory leak information is as follows as also reported by Zhengchao:\n\n  unreferenced object 0xffff888019801800 (size 256):\n  comm \"bpf_repo\", pid 6490, jiffies 4294959200 (age 17.170s)\n  hex dump (first 32 bytes):\n    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n  backtrace:\n    [\u003c00000000b211474b\u003e] __kmalloc_node_track_caller+0x45/0xc0\n    [\u003c0000000086712a0b\u003e] krealloc+0x83/0xd0\n    [\u003c00000000139aab02\u003e] realloc_array+0x82/0xe2\n    [\u003c00000000b1ca41d1\u003e] grow_stack_state+0xfb/0x186\n    [\u003c00000000cd6f36d2\u003e] check_mem_access.cold+0x141/0x1341\n    [\u003c0000000081780455\u003e] do_check_common+0x5358/0xb350\n    [\u003c0000000015f6b091\u003e] bpf_check.cold+0xc3/0x29d\n    [\u003c000000002973c690\u003e] bpf_prog_load+0x13db/0x2240\n    [\u003c00000000028d1644\u003e] __sys_bpf+0x1605/0x4ce0\n    [\u003c00000000053f29bd\u003e] __x64_sys_bpf+0x75/0xb0\n    [\u003c0000000056fedaf5\u003e] do_syscall_64+0x35/0x80\n    [\u003c000000002bd58261\u003e] entry_SYSCALL_64_after_hwframe+0x63/0xcd",
  "id": "GHSA-p39f-f66f-x437",
  "modified": "2025-05-01T15:31:51Z",
  "published": "2025-05-01T15:31:51Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-49878"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/06615967d4889b08b19ff3dda96e8b131282f73d"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/3e210891c4a4c2d858cd6f9f61d5809af251d4df"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/42378a9ca55347102bbf86708776061d8fe3ece2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...

Loading...
  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.