{"id":"CVE-2022-50738","aliases":["CVE-2022-50738"],"related":[],"kind":"vulnerability","state":"published","title":"vhost-vdpa: fix an iotlb memory leak","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nvhost-vdpa: fix an iotlb memory leak\n\nBefore commit 3d5698793897 (\"vhost-vdpa: introduce asid based IOTLB\")\nwe called vhost_vdpa_iotlb_unmap(v, iotlb, 0ULL, 0ULL - 1) during\nrelease to free all the resources allocated when processing user IOTLB\nmessages through vhost_vdpa_process_iotlb_update().\nThat commit changed the handling of IOTLB a bit, and we accidentally\nremoved some code called during the release.\n\nWe partially fixed this with commit 037d4305569a (\"vhost-vdpa: call\nvhost_vdpa_cleanup during the release\") but a potential memory leak is\nstill there as showed by kmemleak if the application does not send\nVHOST_IOTLB_INVALIDATE or crashes:\n\n  unreferenced object 0xffff888007fbaa30 (size 16):\n    comm \"blkio-bench\", pid 914, jiffies 4294993521 (age 885.500s)\n    hex dump (first 16 bytes):\n      40 73 41 07 80 88 ff ff 00 00 00 00 00 00 00 00  @sA.............\n    backtrace:\n      [<0000000087736d2a>] kmem_cache_alloc_trace+0x142/0x1c0\n      [<0000000060740f50>] vhost_vdpa_process_iotlb_msg+0x68c/0x901 [vhost_vdpa]\n      [<0000000083e8e205>] vhost_chr_write_iter+0xc0/0x4a0 [vhost]\n      [<000000008f2f414a>] vhost_vdpa_chr_write_iter+0x18/0x20 [vhost_vdpa]\n      [<00000000de1cd4a0>] vfs_write+0x216/0x4b0\n      [<00000000a2850200>] ksys_write+0x71/0xf0\n      [<00000000de8e720b>] __x64_sys_write+0x19/0x20\n      [<0000000018b12cbb>] do_syscall_64+0x3f/0x90\n      [<00000000986ec465>] entry_SYSCALL_64_after_hwframe+0x63/0xcd\n\nLet's fix this calling vhost_vdpa_iotlb_unmap() on the whole range in\nvhost_vdpa_remove_as(). We move that call before vhost_dev_cleanup()\nsince we need a valid v->vdev.mm in vhost_vdpa_pa_unmap().\nvhost_iotlb_reset() call can be removed, since vhost_vdpa_iotlb_unmap()\non the whole range removes all the entries.\n\nThe kmemleak log reported was observed with a vDPA device that has `use_va`\nset to true (e.g. VDUSE). This patch has been tested with both types of\ndevices.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nvhost-vdpa: fix an iotlb memory leak\n\nBefore commit 3d5698793897 (\"vhost-vdpa: introduce asid based IOTLB\")\nwe called vhost_vdpa_iotlb_unmap(v, iotlb, 0ULL, 0ULL - 1) during\nrelease to free all the resources allocated when processing user IOTLB\nmessages through vhost_vdpa_process_iotlb_update().\nThat commit changed the handling of IOTLB a bit, and we accidentally\nremoved some code called during the release.\n\nWe partially fixed this with commit 037d4305569a (\"vhost-vdpa: call\nvhost_vdpa_cleanup during the release\") but a potential memory leak is\nstill there as showed by kmemleak if the application does not send\nVHOST_IOTLB_INVALIDATE or crashes:\n\n  unreferenced object 0xffff888007fbaa30 (size 16):\n    comm \"blkio-bench\", pid 914, jiffies 4294993521 (age 885.500s)\n    hex dump (first 16 bytes):\n      40 73 41 07 80 88 ff ff 00 00 00 00 00 00 00 00  @sA.............\n    backtrace:\n      [<0000000087736d2a>] kmem_cache_alloc_trace+0x142/0x1c0\n      [<0000000060740f50>] vhost_vdpa_process_iotlb_msg+0x68c/0x901 [vhost_vdpa]\n      [<0000000083e8e205>] vhost_chr_write_iter+0xc0/0x4a0 [vhost]\n      [<000000008f2f414a>] vhost_vdpa_chr_write_iter+0x18/0x20 [vhost_vdpa]\n      [<00000000de1cd4a0>] vfs_write+0x216/0x4b0\n      [<00000000a2850200>] ksys_write+0x71/0xf0\n      [<00000000de8e720b>] __x64_sys_write+0x19/0x20\n      [<0000000018b12cbb>] do_syscall_64+0x3f/0x90\n      [<00000000986ec465>] entry_SYSCALL_64_after_hwframe+0x63/0xcd\n\nLet's fix this calling vhost_vdpa_iotlb_unmap() on the whole range in\nvhost_vdpa_remove_as(). We move that call before vhost_dev_cleanup()\nsince we need a valid v->vdev.mm in vhost_vdpa_pa_unmap().\nvhost_iotlb_reset() call can be removed, since vhost_vdpa_iotlb_unmap()\non the whole range removes all the entries.\n\nThe kmemleak log reported was observed with a vDPA device that has `use_va`\nset to true (e.g. VDUSE). This patch has been tested with both types of\ndevices.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nvhost-vdpa: corrige una fuga de memoria de iotlb\n\nAntes del commit 3d5698793897 (’vhost-vdpa: introduce asid based IOTLB’), llamábamos a vhost_vdpa_iotlb_unmap(v, iotlb, 0ULL, 0ULL - 1) durante la liberación para liberar todos los recursos asignados al procesar mensajes IOTLB de usuario a través de vhost_vdpa_process_iotlb_update(). Ese commit cambió un poco el manejo de IOTLB, y accidentalmente eliminamos parte del código llamado durante la liberación.\n\nCorregimos esto parcialmente con el commit 037d4305569a (’vhost-vdpa: call vhost_vdpa_cleanup during the release’), pero una posible fuga de memoria sigue presente, como lo muestra kmemleak si la aplicación no envía VHOST_IOTLB_INVALIDATE o falla:\n\n  objeto sin referencia 0xffff888007fbaa30 (tamaño 16):\n    comm ’blkio-bench’, pid 914, jiffies 4294993521 (antigüedad 885.500s)\n    volcado hexadecimal (primeros 16 bytes):\n      40 73 41 07 80 88 ff ff 00 00 00 00 00 00 00 00  @sA.............\n    backtrace:\n      [[0000000087736d2a]] kmem_cache_alloc_trace+0x142/0x1c0\n      [[0000000060740f50]] vhost_vdpa_process_iotlb_msg+0x68c/0x901 [vhost_vdpa]\n      [[0000000083e8e205]] vhost_chr_write_iter+0xc0/0x4a0 [vhost]\n      [[000000008f2f414a]] vhost_vdpa_chr_write_iter+0x18/0x20 [vhost_vdpa]\n      [[00000000de1cd4a0]] vfs_write+0x216/0x4b0\n      [[00000000a2850200]] ksys_write+0x71/0xf0\n      [[00000000de8e720b]] __x64_sys_write+0x19/0x20\n      [[0000000018b12cbb]] do_syscall_64+0x3f/0x90\n      [[00000000986ec465]] entry_SYSCALL_64_after_hwframe+0x63/0xcd\n\nCorrijamos esto llamando a vhost_vdpa_iotlb_unmap() en todo el rango en vhost_vdpa_remove_as(). Movemos esa llamada antes de vhost_dev_cleanup() ya que necesitamos un v  ->  vdev.mm válido en vhost_vdpa_pa_unmap(). La llamada a vhost_iotlb_reset() puede eliminarse, ya que vhost_vdpa_iotlb_unmap() en todo el rango elimina todas las entradas.\n\nEl registro de kmemleak reportado se observó con un dispositivo vDPA que tiene ’use_va’ establecido en true (p. ej., VDUSE). Este parche ha sido probado con ambos tipos de dispositivos.","source":"nvd"}],"published":"2025-12-24T13:05:36.801Z","modified":"2026-11-10T12:10:00.177Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"3d5698793897a2b9c0060d899881d1a0591630d5","fixed":"4e92cb33bfb51eee5f28bb10846c46f266a4bb67","status":"affected"},{"type":"git","introduced":"3d5698793897a2b9c0060d899881d1a0591630d5","fixed":"a2907867e2c86067accd2f011d6f23ee5533aa6c","status":"affected"},{"type":"git","introduced":"3d5698793897a2b9c0060d899881d1a0591630d5","fixed":"c070c1912a83432530cbb4271d5b9b11fa36b67a","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.19","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.19","status":"unaffected"},{"type":"semver","introduced":"6.0.19","lastAffected":"6.0.*","status":"unaffected"},{"type":"semver","introduced":"6.1.5","lastAffected":"6.1.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.2","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/4e92cb33bfb51eee5f28bb10846c46f266a4bb67","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a2907867e2c86067accd2f011d6f23ee5533aa6c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c070c1912a83432530cbb4271d5b9b11fa36b67a","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-50738","url":"https://www.cve.org/CVERecord?id=CVE-2022-50738","licence":"CVE Terms of Use","modified":"2026-05-11T19:24:33.729Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-50738","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50738","licence":"Public domain","modified":"2026-11-10T12:10:00.177Z"}],"updatedAt":"2026-11-25T22:58:21.340Z","epss":{"score":0.00252,"percentile":0.17812,"date":"2026-12-01T12:00:22.000Z"}}