CVE-2022-50314: nbd: Fix hung when signal interrupts nbd_start_device_ioctl()
In the Linux kernel, the following vulnerability has been resolved:
nbd: Fix hung when signal interrupts nbdstartdeviceioctl()
syzbot reported hung task [1]. The following program is a simplified version of the reproducer:
int main(void) { int sv[2], fd;
if (socketpair(AFUNIX, SOCKSTREAM, 0, sv) < 0) return 1; if ((fd = open("/dev/nbd0", 0)) < 0) return 1; if (ioctl(fd, NBDSETSIZEBLOCKS, 0x81) < 0) return 1; if (ioctl(fd, NBDSETSOCK, sv[0]) < 0) return 1; if (ioctl(fd, NBDDOIT) < 0) return 1; return 0; }
When signal interrupt nbdstartdeviceioctl() waiting the condition atomicread(&config->recvthreads) == 0, the task can hung because it waits the completion of the inflight IOs.
This patch fixes the issue by clearing queue, not just shutdown, when signal interrupt nbdstartdeviceioctl().
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2022-50314?
CVE-2022-50314 is classified as a minor severity vulnerability in the Linux kernel.
How do I fix CVE-2022-50314?
To fix CVE-2022-50314, you should update your Linux kernel to the latest version that includes the patches for this vulnerability.
What type of vulnerability is CVE-2022-50314?
CVE-2022-50314 is related to a hung task caused by a signal interrupt in the nbd_start_device_ioctl() function within the Linux kernel.
Which versions of the Linux kernel are affected by CVE-2022-50314?
CVE-2022-50314 affects certain versions of the Linux kernel prior to the application of specific patches that resolve the issue.
What are the potential impacts of CVE-2022-50314?
The potential impact of CVE-2022-50314 is a hung task which could lead to denial of service due to process stalls in the system.