Skip to content
OpenAdvisories
High · 7.8 CVE-2021-47196 EUVD-2021-33844GHSA-j2j3-mjcj-v75r

RDMA/core: Set send and receive CQ before forwarding to the driver

Published Apr 10, 2024 · Updated Aug 5, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: linux Package: linux-allwinner-5.19 Package: linux-aws-5.0 Package: linux-aws-5.11 Package: linux-aws-5.13 Package: linux-aws-5.19 Package: linux-aws-5.3 Package: linux-aws-5.8 Package: linux-aws-6.2 Package: linux-azure Package: linux-azure-5.11 Package: linux-azure-5.13 Package: linux-azure-5.19 Package: linux-azure-5.3 Package: linux-azure-5.8 Package: linux-azure-6.2 Package: linux-azure-edge Package: linux-azure-fde Package: linux-azure-fde-5.19 Package: linux-azure-fde-6.2 Package: linux-gcp Package: linux-gcp-5.11 Package: linux-gcp-5.13 Package: linux-gcp-5.19 Package: linux-gcp-5.3 Package: linux-gcp-5.8 Package: linux-gcp-6.2 Package: linux-gke Package: linux-gke-4.15 Package: linux-gke-5.15 Package: linux-gke-5.4 Package: linux-gkeop-5.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.19 Package: linux-hwe-5.8 Package: linux-hwe-6.2 Package: linux-hwe-edge Package: linux-intel-5.13 Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.2 Package: linux-nvidia-6.2 Package: linux-oem Package: linux-oem-5.10 Package: linux-oem-5.13 Package: linux-oem-5.14 Package: linux-oem-5.17 Package: linux-oem-5.6 Package: linux-oem-6.0 Package: linux-oem-6.1 Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.3 Package: linux-oracle-5.8 Package: linux-raspi2 Package: linux-riscv Package: linux-riscv-5.11 Package: linux-riscv-5.19 Package: linux-riscv-5.8 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Platform: Linux Ecosystem: Debian Ecosystem: Ubuntu

Description

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

RDMA/core: Set send and receive CQ before forwarding to the driver

Preset both receive and send CQ pointers prior to call to the drivers and
overwrite it later again till the mlx4 is going to be changed do not
overwrite ibqp properties.

This change is needed for mlx5, because in case of QP creation failure, it
will go to the path of QP destroy which relies on proper CQ pointers.

BUG: KASAN: use-after-free in create_qp.cold+0x164/0x16e [mlx5_ib]
Write of size 8 at addr ffff8880064c55c0 by task a.out/246

CPU: 0 PID: 246 Comm: a.out Not tainted 5.15.0+ #291
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
Call Trace:
dump_stack_lvl+0x45/0x59
print_address_description.constprop.0+0x1f/0x140
kasan_report.cold+0x83/0xdf
create_qp.cold+0x164/0x16e [mlx5_ib]
mlx5_ib_create_qp+0x358/0x28a0 [mlx5_ib]
create_qp.part.0+0x45b/0x6a0 [ib_core]
ib_create_qp_user+0x97/0x150 [ib_core]
ib_uverbs_handler_UVERBS_METHOD_QP_CREATE+0x92c/0x1250 [ib_uverbs]
ib_uverbs_cmd_verbs+0x1c38/0x3150 [ib_uverbs]
ib_uverbs_ioctl+0x169/0x260 [ib_uverbs]
__x64_sys_ioctl+0x866/0x14d0
do_syscall_64+0x3d/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae

Allocated by task 246:
kasan_save_stack+0x1b/0x40
__kasan_kmalloc+0xa4/0xd0
create_qp.part.0+0x92/0x6a0 [ib_core]
ib_create_qp_user+0x97/0x150 [ib_core]
ib_uverbs_handler_UVERBS_METHOD_QP_CREATE+0x92c/0x1250 [ib_uverbs]
ib_uverbs_cmd_verbs+0x1c38/0x3150 [ib_uverbs]
ib_uverbs_ioctl+0x169/0x260 [ib_uverbs]
__x64_sys_ioctl+0x866/0x14d0
do_syscall_64+0x3d/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae

Freed by task 246:
kasan_save_stack+0x1b/0x40
kasan_set_track+0x1c/0x30
kasan_set_free_info+0x20/0x30
__kasan_slab_free+0x10c/0x150
slab_free_freelist_hook+0xb4/0x1b0
kfree+0xe7/0x2a0
create_qp.part.0+0x52b/0x6a0 [ib_core]
ib_create_qp_user+0x97/0x150 [ib_core]
ib_uverbs_handler_UVERBS_METHOD_QP_CREATE+0x92c/0x1250 [ib_uverbs]
ib_uverbs_cmd_verbs+0x1c38/0x3150 [ib_uverbs]
ib_uverbs_ioctl+0x169/0x260 [ib_uverbs]
__x64_sys_ioctl+0x866/0x14d0
do_syscall_64+0x3d/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae

Affected products

VendorProductAffectedFixed
Linux Linux 5.15 5.15.5

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 linux 5.15.5-1 —
Debian 13 linux 5.15.5-1 —
Debian 12 linux 5.15.5-1 —
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS linux-riscv +20 No fix yet —
Ubuntu 20.04 LTS linux-gke +26 No fix yet —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
ReleasePackageFixed inAdvisory
SLES 15 SP5 kernel-64kb +5 5.14.21-150500.55.62.2 SUSE-SU-2024:1659-1
SLES 15 SP5 kernel-azure +2 5.14.21-150500.33.51.1 SUSE-SU-2024:1644-1
SLES 15 SP5 kernel-default-base 5.14.21-150500.55.62.2.150500.6.27.2 SUSE-SU-2024:1659-1
SLES 15 SP5 kernel-syms 5.14.21-150500.55.62.1 SUSE-SU-2024:1659-1
SLES 15 SP4 kernel-64kb +6 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
SLES 15 SP4 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
Show 10 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP4 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
SLES for SAP 15 SP4 kernel-docs +4 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
SLE Micro 5.5 kernel-default 5.14.21-150500.55.62.2 SUSE-SU-2024:1659-1
SLE Micro 5.5 kernel-default-base 5.14.21-150500.55.62.2.150500.6.27.2 SUSE-SU-2024:1659-1
SLE Micro 5.5 kernel-rt +1 5.14.21-150500.13.52.1 SUSE-SU-2024:1663-1
SLE Micro 5.4 kernel-default 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
SLE Micro 5.4 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
SLE Micro 5.4 kernel-rt +1 5.14.21-150400.15.79.1 SUSE-SU-2024:1647-1
SLE Micro 5.3 kernel-default 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
SLE Micro 5.3 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
SLE Micro 5.3 kernel-rt +1 5.14.21-150400.15.79.1 SUSE-SU-2024:1647-1
SLE Live Patching 15 SP5 kernel-default 5.14.21-150500.55.62.2 SUSE-SU-2024:1659-1
SLE Live Patching 15 SP5 kernel-livepatch-SLE15-SP5-RT_Update_14 1-150500.11.5.1 SUSE-SU-2024:1663-1
SLE Live Patching 15 SP5 kernel-livepatch-SLE15-SP5_Update_13 1-150500.11.3.2 SUSE-SU-2024:1659-1
SLE Live Patching 15 SP4 kernel-default 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
SLE Live Patching 15 SP4 kernel-livepatch-SLE15-SP4_Update_26 1-150400.9.3.1 SUSE-SU-2024:1641-1
SLE HPC 15 SP4 kernel-64kb +5 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
SLE HPC 15 SP4 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
SUSE Real Time Module 15 SP5 kernel-rt +3 5.14.21-150500.13.52.1 SUSE-SU-2024:1663-1
SUSE Manager Server 4.3 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
SUSE Manager Server 4.3 kernel-syms +3 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
SUSE Manager Proxy 4.3 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
SUSE Manager Proxy 4.3 kernel-syms +2 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.5 dtb-aarch64 +2 5.14.21-150500.55.62.1 SUSE-SU-2024:1659-1
openSUSE Leap 15.5 kernel-64kb +7 5.14.21-150500.55.62.2 SUSE-SU-2024:1659-1
openSUSE Leap 15.5 kernel-azure +2 5.14.21-150500.33.51.1 SUSE-SU-2024:1644-1
openSUSE Leap 15.5 kernel-default-base 5.14.21-150500.55.62.2.150500.6.27.2 SUSE-SU-2024:1659-1
openSUSE Leap 15.5 kernel-rt +3 5.14.21-150500.13.52.1 SUSE-SU-2024:1663-1
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
openSUSE Leap Micro 5.4 kernel-default 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
openSUSE Leap Micro 5.4 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
openSUSE Leap Micro 5.4 kernel-rt 5.14.21-150400.15.79.1 SUSE-SU-2024:1647-1
openSUSE Leap Micro 5.3 kernel-default 5.14.21-150400.24.119.1 SUSE-SU-2024:1641-1
openSUSE Leap Micro 5.3 kernel-default-base 5.14.21-150400.24.119.1.150400.24.56.1 SUSE-SU-2024:1641-1
openSUSE Leap Micro 5.3 kernel-rt 5.14.21-150400.15.79.1 SUSE-SU-2024:1647-1

Advisories 6

References