CVE-2021-47212: net/mlx5: Update error handler for UCTX and UMEM
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5: Update error handler for UCTX and UMEM
In the fast unload flow, the device state is set to internal error, which indicates that the driver started the destroy process. In this case, when a destroy command is being executed, it should return MLX5CMDSTATOK. Fix MLX5CMDOPDESTROYUCTX and MLX5CMDOPDESTROYUMEM to return OK instead of EIO.
This fixes a call trace in the umem release process - [ 2633.536695] Call Trace: [ 2633.537518] ibuverbsremoveone+0xc3/0x140 [ibuverbs] [ 2633.538596] removeclientcontext+0x8b/0xd0 [ibcore] [ 2633.539641] disabledevice+0x8c/0x130 [ibcore] [ 2633.540615] ibunregisterdevice+0x35/0xa0 [ibcore] [ 2633.541640] ibunregisterdevice+0x21/0x30 [ibcore] [ 2633.542663] mlx5ibremove+0x38/0x90 [mlx5ib] [ 2633.543640] auxiliarybusremove+0x1e/0x30 [auxiliary] [ 2633.544661] devicereleasedriverinternal+0x103/0x1f0 [ 2633.545679] busremovedevice+0xf7/0x170 [ 2633.546640] devicedel+0x181/0x410 [ 2633.547606] mlx5rescandriverslocked.part.10+0x63/0x160 [mlx5core] [ 2633.548777] mlx5unregisterdevice+0x27/0x40 [mlx5core] [ 2633.549841] mlx5uninitone+0x21/0xc0 [mlx5core] [ 2633.550864] removeone+0x69/0xe0 [mlx5core] [ 2633.551819] pcideviceremove+0x3b/0xc0 [ 2633.552731] devicereleasedriverinternal+0x103/0x1f0 [ 2633.553746] unbindstore+0xf6/0x130 [ 2633.554657] kernfsfopwrite+0x116/0x190 [ 2633.555567] vfswrite+0xa5/0x1a0 [ 2633.556407] ksyswrite+0x4f/0xb0 [ 2633.557233] dosyscall64+0x5b/0x1a0 [ 2633.558071] entrySYSCALL64afterhwframe+0x65/0xca [ 2633.559018] RIP: 0033:0x7f9977132648 [ 2633.559821] Code: 89 02 48 c7 c0 ff ff ff ff eb b3 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 55 6f 2d 00 8b 00 85 c0 75 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 41 54 49 89 d4 55 [ 2633.562332] RSP: 002b:00007fffb1a83888 EFLAGS: 00000246 ORIGRAX: 0000000000000001 [ 2633.563472] RAX: ffffffffffffffda RBX: 000000000000000c RCX: 00007f9977132648 [ 2633.564541] RDX: 000000000000000c RSI: 000055b90546e230 RDI: 0000000000000001 [ 2633.565596] RBP: 000055b90546e230 R08: 00007f9977406860 R09: 00007f9977a54740 [ 2633.566653] R10: 0000000000000000 R11: 0000000000000246 R12: 00007f99774056e0 [ 2633.567692] R13: 000000000000000c R14: 00007f9977400880 R15: 000000000000000c [ 2633.568725] ---[ end trace 10b4fe52945e544d ]---
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1 - Compensating control
Update the mlx5 error handler so MLX5_CMD_OP_DESTROY_UCTX and MLX5_CMD_OP_DESTROY_UMEM return MLX5_CMD_STAT_OK instead of EIO when the device is in internal error state during the fast unload destroy process.
Event History
Frequently Asked Questions
What is the severity of CVE-2021-47212?
CVE-2021-47212 is considered a medium severity vulnerability in the Linux kernel.
How do I fix CVE-2021-47212?
To fix CVE-2021-47212, upgrade your Linux kernel to a version that includes the patches, such as 6.1.123-1 or 6.12.12-1.
Which versions of Linux are affected by CVE-2021-47212?
CVE-2021-47212 affects Linux kernel versions up to and including 5.10.226-1.
What are the implications of CVE-2021-47212?
The implications of CVE-2021-47212 include potential internal errors during device state management in the fast unload flow.
What systems should prioritize patching for CVE-2021-47212?
Systems running affected versions of the Linux kernel, especially those using the mlx5 driver, should prioritize patching for CVE-2021-47212.