# CVE-2022-50726: linux: In the Linux kernel, the following vulnerability has been resolved:  net/mlx5: Fix possible use-after-free in async c...

CVE-2022-50726 is fixed in 47 products on 1 platform, first by RHSA-2023:2458, released May 9, 2023. It is not reported as exploited. Patch Radar priority: High.

- Web page: https://patchblox.com/security/cve/CVE-2022-50726
- Priority: High
- CVSS: 7.8 (high)
- EPSS: 0.0019
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: May 9, 2023

## Description

In the Linux kernel, the following vulnerability has been resolved:  net/mlx5: Fix possible use-after-free in async command interface  mlx5_cmd_cleanup_async_ctx should return only after all its callback handlers were completed. Before this patch, the below race between mlx5_cmd_cleanup_async_ctx and mlx5_cmd_exec_cb_handler was possible and lead to a use-after-free:  1. mlx5_cmd_cleanup_async_ctx is called while num_inflight is 2 (i.e.    elevated by 1, a single inflight callback). 2. mlx5_cmd_cleanup_async_ctx decreases num_inflight to 1. 3. mlx5_cmd_exec_cb_handler is called, decreases num_inflight to 0 and    is about to call wake_up(). 4. mlx5_cmd_cleanup_async_ctx calls wait_event, which returns    immediately as the condition (num_inflight == 0) holds. 5. mlx5_cmd_cleanup_async_ctx returns. 6. The caller of mlx5_cmd_cleanup_async_ctx frees the mlx5_async_ctx    object. 7. mlx5_cmd_exec_cb_handler goes on and calls wake_up() on the freed    object.  Fix it by syncing using a completion object. Mark it completed when num_inflight reaches 0.  Trace:  BUG: KASAN: use-after-free in do_raw_spin_lock+0x23d/0x270 Read of size 4 at addr ffff888139cd12f4 by task swapper/5/0  CPU: 5 PID: 0 Comm: swapper/5 Not tainted 6.0.0-rc3_for_upstream_debug_2022_08_30_13_10 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace:  <IRQ>  dump_stack_lvl+0x57/0x7d  print_report.cold+0x2d5/0x684  ? do_raw_spin_lock+0x23d/0x270  kasan_report+0xb1/0x1a0  ? do_raw_spin_lock+0x23d/0x270  do_raw_spin_lock+0x23d/0x270  ? rwlock_bug.part.0+0x90/0x90  ? __delete_object+0xb8/0x100  ? lock_downgrade+0x6e0/0x6e0  _raw_spin_lock_irqsave+0x43/0x60  ? __wake_up_common_lock+0xb9/0x140  __wake_up_common_lock+0xb9/0x140  ? __wake_up_common+0x650/0x650  ? destroy_tis_callback+0x53/0x70 [mlx5_core]  ? kasan_set_track+0x21/0x30  ? destroy_tis_callback+0x53/0x70 [mlx5_core]  ? kfree+0x1ba/0x520  ? do_raw_spin_unlock+0x54/0x220  mlx5_cmd_exec_cb_handler+0x136/0x1a0 [mlx5_core]  ? mlx5_cmd_cleanup_async_ctx+0x220/0x220 [mlx5_core]  ? mlx5_cmd_cleanup_async_ctx+0x220/0x220 [mlx5_core]  mlx5_cmd_comp_handler+0x65a/0x12b0 [mlx5_core]  ? dump_command+0xcc0/0xcc0 [mlx5_core]  ? lockdep_hardirqs_on_prepare+0x400/0x400  ? cmd_comp_notifier+0x7e/0xb0 [mlx5_core]  cmd_comp_notifier+0x7e/0xb0 [mlx5_core]  atomic_notifier_call_chain+0xd7/0x1d0  mlx5_eq_async_int+0x3ce/0xa20 [mlx5_core]  atomic_notifier_call_chain+0xd7/0x1d0  ? irq_release+0x140/0x140 [mlx5_core]  irq_int_handler+0x19/0x30 [mlx5_core]  __handle_irq_event_percpu+0x1f2/0x620  handle_irq_event+0xb2/0x1d0  handle_edge_irq+0x21e/0xb00  __common_interrupt+0x79/0x1a0  common_interrupt+0x78/0xa0  </IRQ>  <TASK>  asm_common_interrupt+0x22/0x40 RIP: 0010:default_idle+0x42/0x60 Code: c1 83 e0 07 48 c1 e9 03 83 c0 03 0f b6 14 11 38 d0 7c 04 84 d2 75 14 8b 05 eb 47 22 02 85 c0 7e 07 0f 00 2d e0 9f 48 00 fb f4 <c3> 48 c7 c7 80 08 7f 85 e8 d1 d3 3e fe eb de 66 66 2e 0f 1f 84 00 RSP: 0018:ffff888100dbfdf0 EFLAGS: 00000242 RAX: 0000000000000001 RBX: ffffffff84ecbd48 RCX: 1ffffffff0afe110 RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffffffff835cc9bc RBP: 0000000000000005 R08: 0000000000000001 R09: ffff88881dec4ac3 R10: ffffed1103bd8958 R11: 0000017d0ca571c9 R12: 0000000000000005 R13: ffffffff84f024e0 R14: 0000000000000000 R15: dffffc0000000000  ? default_idle_call+0xcc/0x450  default_idle_call+0xec/0x450  do_idle+0x394/0x450  ? arch_cpu_idle_exit+0x40/0x40  ? do_idle+0x17/0x450  cpu_startup_entry+0x19/0x20  start_secondary+0x221/0x2b0  ? set_cpu_sibling_map+0x2070/0x2070  secondary_startup_64_no_verify+0xcd/0xdb  </TASK>  Allocated by task 49502:  kasan_save_stack+0x1e/0x40  __kasan_kmalloc+0x81/0xa0  kvmalloc_node+0x48/0xe0  mlx5e_bulk_async_init+0x35/0x110 [mlx5_core]  mlx5e_tls_priv_tx_list_cleanup+0x84/0x3e0 [mlx5_core]  mlx5e_ktls_cleanup_tx+0x38f/0x760 [mlx5_core]  mlx5e_cleanup_nic_tx+0xa7/0x100 [mlx5_core]  mlx5e_detach_netdev+0x1c ---truncated---

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | bpftool RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | bpftool RHEL 9 | 0:7.0.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-debug RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-debug-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-debug-devel RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-debug-devel-matched RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-debug-modules RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-debug-modules-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-debug-modules-extra RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-devel RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-devel-matched RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-modules RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-modules-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-64k-modules-extra RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-abi-stablelists RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-abi-stablelists RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-core RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-debug RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-debug RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-debug-core RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-debug-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-debug-devel RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-debug-devel RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-debug-devel-matched RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-debug-modules RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-debug-modules RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-debug-modules-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-debug-modules-extra RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-debug-modules-extra RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-debug-uki-virt RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-devel RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-devel RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-devel-matched RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-doc RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-doc RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-modules RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-modules RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-modules-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-modules-extra RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-modules-extra RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-tools RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-tools RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-tools-libs RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-tools-libs RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-tools-libs-devel RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-tools-libs-devel RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-uki-virt RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-zfcpdump RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-zfcpdump RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-zfcpdump-core RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-zfcpdump-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-zfcpdump-devel RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-zfcpdump-devel RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-zfcpdump-devel-matched RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-zfcpdump-modules RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-zfcpdump-modules RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-zfcpdump-modules-core RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | kernel-zfcpdump-modules-extra RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | kernel-zfcpdump-modules-extra RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | linux Debian 12.15 (bookworm) | 6.0.7-1 | [DEBIAN-CVE-2022-50726](https://patchblox.com/security/data/fix/linux/debian-cve-2022-50726.md) | Dec 24, 2025 |
| Linux | linux Debian 13.5 (trixie) | 6.0.7-1 | [DEBIAN-CVE-2022-50726](https://patchblox.com/security/data/fix/linux/debian-cve-2022-50726.md) | Dec 24, 2025 |
| Linux | linux Debian 14 | 6.0.7-1 | [DEBIAN-CVE-2022-50726](https://patchblox.com/security/data/fix/linux/debian-cve-2022-50726.md) | Dec 24, 2025 |
| Linux | perf RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | perf RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | python3-perf RHEL 8 | 0:4.18.0-477.10.1.el8_8 | [RHSA-2023:2951](https://patchblox.com/security/data/fix/linux/rhsa-2023-2951.md) | May 16, 2023 |
| Linux | python3-perf RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |
| Linux | rtla RHEL 9 | 0:5.14.0-284.11.1.el9_2 | [RHSA-2023:2458](https://patchblox.com/security/data/fix/linux/rhsa-2023-2458.md) | May 9, 2023 |

---

Data as of 2026-11-09T01:18:40Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
