{"id":"CVE-2022-50774","aliases":["CVE-2022-50774"],"related":[],"kind":"vulnerability","state":"published","title":"crypto: qat - fix DMA transfer direction","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: qat - fix DMA transfer direction\n\nWhen CONFIG_DMA_API_DEBUG is selected, while running the crypto self\ntest on the QAT crypto algorithms, the function add_dma_entry() reports\na warning similar to the one below, saying that overlapping mappings\nare not supported. This occurs in tests where the input and the output\nscatter list point to the same buffers (i.e. two different scatter lists\nwhich point to the same chunks of memory).\n\nThe logic that implements the mapping uses the flag DMA_BIDIRECTIONAL\nfor both the input and the output scatter lists which leads to\noverlapped write mappings. These are not supported by the DMA layer.\n\nFix by specifying the correct DMA transfer directions when mapping\nbuffers. For in-place operations where the input scatter list\nmatches the output scatter list, buffers are mapped once with\nDMA_BIDIRECTIONAL, otherwise input buffers are mapped using the flag\nDMA_TO_DEVICE and output buffers are mapped with DMA_FROM_DEVICE.\nOverlapping a read mapping with a write mapping is a valid case in\ndma-coherent devices like QAT.\nThe function that frees and unmaps the buffers, qat_alg_free_bufl()\nhas been changed accordingly to the changes to the mapping function.\n\n   DMA-API: 4xxx 0000:06:00.0: cacheline tracking EEXIST, overlapping mappings aren't supported\n   WARNING: CPU: 53 PID: 4362 at kernel/dma/debug.c:570 add_dma_entry+0x1e9/0x270\n   ...\n   Call Trace:\n   dma_map_page_attrs+0x82/0x2d0\n   ? preempt_count_add+0x6a/0xa0\n   qat_alg_sgl_to_bufl+0x45b/0x990 [intel_qat]\n   qat_alg_aead_dec+0x71/0x250 [intel_qat]\n   crypto_aead_decrypt+0x3d/0x70\n   test_aead_vec_cfg+0x649/0x810\n   ? number+0x310/0x3a0\n   ? vsnprintf+0x2a3/0x550\n   ? scnprintf+0x42/0x70\n   ? valid_sg_divisions.constprop.0+0x86/0xa0\n   ? test_aead_vec+0xdf/0x120\n   test_aead_vec+0xdf/0x120\n   alg_test_aead+0x185/0x400\n   alg_test+0x3d8/0x500\n   ? crypto_acomp_scomp_free_ctx+0x30/0x30\n   ? __schedule+0x32a/0x12a0\n   ? ttwu_queue_wakelist+0xbf/0x110\n   ? _raw_spin_unlock_irqrestore+0x23/0x40\n   ? try_to_wake_up+0x83/0x570\n   ? _raw_spin_unlock_irqrestore+0x23/0x40\n   ? __set_cpus_allowed_ptr_locked+0xea/0x1b0\n   ? crypto_acomp_scomp_free_ctx+0x30/0x30\n   cryptomgr_test+0x27/0x50\n   kthread+0xe6/0x110\n   ? kthread_complete_and_exit+0x20/0x20\n   ret_from_fork+0x1f/0x30","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: qat - fix DMA transfer direction\n\nWhen CONFIG_DMA_API_DEBUG is selected, while running the crypto self\ntest on the QAT crypto algorithms, the function add_dma_entry() reports\na warning similar to the one below, saying that overlapping mappings\nare not supported. This occurs in tests where the input and the output\nscatter list point to the same buffers (i.e. two different scatter lists\nwhich point to the same chunks of memory).\n\nThe logic that implements the mapping uses the flag DMA_BIDIRECTIONAL\nfor both the input and the output scatter lists which leads to\noverlapped write mappings. These are not supported by the DMA layer.\n\nFix by specifying the correct DMA transfer directions when mapping\nbuffers. For in-place operations where the input scatter list\nmatches the output scatter list, buffers are mapped once with\nDMA_BIDIRECTIONAL, otherwise input buffers are mapped using the flag\nDMA_TO_DEVICE and output buffers are mapped with DMA_FROM_DEVICE.\nOverlapping a read mapping with a write mapping is a valid case in\ndma-coherent devices like QAT.\nThe function that frees and unmaps the buffers, qat_alg_free_bufl()\nhas been changed accordingly to the changes to the mapping function.\n\n   DMA-API: 4xxx 0000:06:00.0: cacheline tracking EEXIST, overlapping mappings aren't supported\n   WARNING: CPU: 53 PID: 4362 at kernel/dma/debug.c:570 add_dma_entry+0x1e9/0x270\n   ...\n   Call Trace:\n   dma_map_page_attrs+0x82/0x2d0\n   ? preempt_count_add+0x6a/0xa0\n   qat_alg_sgl_to_bufl+0x45b/0x990 [intel_qat]\n   qat_alg_aead_dec+0x71/0x250 [intel_qat]\n   crypto_aead_decrypt+0x3d/0x70\n   test_aead_vec_cfg+0x649/0x810\n   ? number+0x310/0x3a0\n   ? vsnprintf+0x2a3/0x550\n   ? scnprintf+0x42/0x70\n   ? valid_sg_divisions.constprop.0+0x86/0xa0\n   ? test_aead_vec+0xdf/0x120\n   test_aead_vec+0xdf/0x120\n   alg_test_aead+0x185/0x400\n   alg_test+0x3d8/0x500\n   ? crypto_acomp_scomp_free_ctx+0x30/0x30\n   ? __schedule+0x32a/0x12a0\n   ? ttwu_queue_wakelist+0xbf/0x110\n   ? _raw_spin_unlock_irqrestore+0x23/0x40\n   ? try_to_wake_up+0x83/0x570\n   ? _raw_spin_unlock_irqrestore+0x23/0x40\n   ? __set_cpus_allowed_ptr_locked+0xea/0x1b0\n   ? crypto_acomp_scomp_free_ctx+0x30/0x30\n   cryptomgr_test+0x27/0x50\n   kthread+0xe6/0x110\n   ? kthread_complete_and_exit+0x20/0x20\n   ret_from_fork+0x1f/0x30","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ncrypto: qat - corregir la dirección de transferencia DMA\n\nCuando CONFIG_DMA_API_DEBUG está seleccionado, mientras se ejecuta la autoprueba criptográfica en los algoritmos criptográficos QAT, la función add_dma_entry() informa una advertencia similar a la siguiente, indicando que las asignaciones superpuestas no son compatibles. Esto ocurre en pruebas donde la lista de dispersión de entrada y la de salida apuntan a los mismos búferes (es decir, dos listas de dispersión diferentes que apuntan a los mismos bloques de memoria).\n\nLa lógica que implementa la asignación utiliza el indicador DMA_BIDIRECTIONAL tanto para las listas de dispersión de entrada como para las de salida, lo que lleva a asignaciones de escritura superpuestas. Estas no son compatibles con la capa DMA.\n\nSe corrige especificando las direcciones de transferencia DMA correctas al asignar búferes. Para operaciones in situ donde la lista de dispersión de entrada coincide con la lista de dispersión de salida, los búferes se asignan una vez con DMA_BIDIRECTIONAL; de lo contrario, los búferes de entrada se asignan utilizando el indicador DMA_TO_DEVICE y los búferes de salida se asignan con DMA_FROM_DEVICE. Superponer una asignación de lectura con una asignación de escritura es un caso válido en dispositivos coherentes con DMA como QAT.\nLa función que libera y desasigna los búferes, qat_alg_free_bufl(), ha sido modificada en consecuencia a los cambios en la función de asignación.\n\nDMA-API: 4xxx 0000:06:00.0: seguimiento de línea de caché EEXIST, las asignaciones superpuestas no son compatibles\nADVERTENCIA: CPU: 53 PID: 4362 en kernel/dma/debug.c:570 add_dma_entry+0x1e9/0x270\n...\nRastro de Llamada:\ndma_map_page_attrs+0x82/0x2d0\n? preempt_count_add+0x6a/0xa0\nqat_alg_sgl_to_bufl+0x45b/0x990 [intel_qat]\nqat_alg_aead_dec+0x71/0x250 [intel_qat]\ncrypto_aead_decrypt+0x3d/0x70\ntest_aead_vec_cfg+0x649/0x810\n? number+0x310/0x3a0\n? vsnprintf+0x2a3/0x550\n? scnprintf+0x42/0x70\n? valid_sg_divisions.constprop.0+0x86/0xa0\n? test_aead_vec+0xdf/0x120\ntest_aead_vec+0xdf/0x120\nalg_test_aead+0x185/0x400\nalg_test+0x3d8/0x500\n? crypto_acomp_scomp_free_ctx+0x30/0x30\n? __schedule+0x32a/0x 12a0\n? ttwu_queue_wakelist+0xbf/0x110\n? _raw_spin_unlock_irqrestore+0x23/0x40\n? try_to_wake_up+0x83/0x570\n? _raw_spin_unlock_irqrestore+0x23/0x40\n? __set_cpus_allowed_ptr_locked+0xea/0x1b0\n? crypto_acomp_scomp_free_ctx+0x30/0x30\ncryptomgr_test+0x27/0x50\nkthread+0xe6/0x110\n? kthread_complete_and_exit+0x20/0x20\nret_from_fork+0x1f/0x30","source":"nvd"}],"published":"2025-12-24T13:06:04.391Z","modified":"2026-11-10T12:10:00.177Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"d370cec3219490656d72f5ae6e5df32c113c5a44","fixed":"426d5bc089e7731e36b514d1beca19e777a2d653","status":"affected"},{"type":"git","introduced":"d370cec3219490656d72f5ae6e5df32c113c5a44","fixed":"1f1ab76e251521bd2fa5244473efcf663792745d","status":"affected"},{"type":"git","introduced":"d370cec3219490656d72f5ae6e5df32c113c5a44","fixed":"429348d4f675e9eb418d0829064c4d7d06bd66a3","status":"affected"},{"type":"git","introduced":"d370cec3219490656d72f5ae6e5df32c113c5a44","fixed":"c4c9d9edf4848aed89516b23b88950b194beff6a","status":"affected"},{"type":"git","introduced":"d370cec3219490656d72f5ae6e5df32c113c5a44","fixed":"cf5bb835b7c8a5fee7f26455099cca7feb57f5e9","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.17","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.17","status":"unaffected"},{"type":"semver","introduced":"5.10.150","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.75","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.19.17","lastAffected":"5.19.*","status":"unaffected"},{"type":"semver","introduced":"6.0.3","lastAffected":"6.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.1","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/426d5bc089e7731e36b514d1beca19e777a2d653","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1f1ab76e251521bd2fa5244473efcf663792745d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/429348d4f675e9eb418d0829064c4d7d06bd66a3","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c4c9d9edf4848aed89516b23b88950b194beff6a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/cf5bb835b7c8a5fee7f26455099cca7feb57f5e9","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-50774","url":"https://www.cve.org/CVERecord?id=CVE-2022-50774","licence":"CVE Terms of Use","modified":"2026-05-11T19:25:17.195Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-50774","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50774","licence":"Public domain","modified":"2026-11-10T12:10:00.177Z"}],"updatedAt":"2026-11-25T22:58:21.356Z","epss":{"score":0.00277,"percentile":0.21605,"date":"2026-12-01T12:00:22.000Z"}}