CVE-2022-50064: virtio-blk: Avoid use-after-free on suspend/resume
In the Linux kernel, the following vulnerability has been resolved:
virtio-blk: Avoid use-after-free on suspend/resume
hctx->userdata is set to vq in virtblkinithctx(). However, vq is freed on suspend and reallocated on resume. So, hctx->userdata is invalid after resume, and it will cause use-after-free accessing which will result in the kernel crash something like below:
[ 22.428391] Call Trace: [ 22.428899] <TASK> [ 22.429339] virtqueueaddsplit+0x3eb/0x620 [ 22.430035] ? blkmqallocrequests+0x17f/0x2d0 [ 22.430789] ? kvmclockgetcycles+0x14/0x30 [ 22.431496] virtqueueaddsgs+0xad/0xd0 [ 22.432108] virtblkaddreq+0xe8/0x150 [ 22.432692] virtioqueuerqs+0xeb/0x210 [ 22.433330] blkmqflushpluglist+0x1b8/0x280 [ 22.434059] blkflushplug+0xe1/0x140 [ 22.434853] blkfinishplug+0x20/0x40 [ 22.435512] readpages+0x20a/0x2e0 [ 22.436063] ? folioaddlru+0x62/0xa0 [ 22.436652] pagecacheraunbounded+0x112/0x160 [ 22.437365] filemapgetpages+0xe1/0x5b0 [ 22.437964] ? contexttosid+0x70/0x100 [ 22.438580] ? sidtabcontexttosid+0x32/0x400 [ 22.439979] filemapread+0xcd/0x3d0 [ 22.440917] xfsfilebufferedread+0x4a/0xc0 [ 22.441984] xfsfilereaditer+0x65/0xd0 [ 22.442970] kernelread+0x160/0x2e0 [ 22.443921] bprmexecve+0x21b/0x640 [ 22.444809] doexecveatcommon.isra.0+0x1a8/0x220 [ 22.446008] x64sysexecve+0x2d/0x40 [ 22.446920] dosyscall64+0x37/0x90 [ 22.447773] entrySYSCALL64afterhwframe+0x63/0xcd
This patch fixes this issue by getting vq from vblk, and removes virtblkinithctx().
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.0.2-1
Event History
Frequently Asked Questions
What is the severity of CVE-2022-50064?
CVE-2022-50064 has a medium severity rating due to the potential for use-after-free vulnerabilities during suspend and resume operations.
How do I fix CVE-2022-50064?
To fix CVE-2022-50064, ensure you update to the patched version of the Linux kernel where this vulnerability has been resolved.
What systems are affected by CVE-2022-50064?
CVE-2022-50064 affects systems running vulnerable versions of the Linux kernel that utilize virtio-blk.
What are the risks of not patching CVE-2022-50064?
Not patching CVE-2022-50064 could lead to potential data corruption or system instability due to use-after-free conditions.
When was CVE-2022-50064 identified?
CVE-2022-50064 was identified in 2022 and addresses a specific issue in the Linux kernel's virtio-blk implementation.