CVE-2022-50620: f2fs: fix to invalidate dcc->f2fs_issue_discard in error path
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to invalidate dcc->f2fsissuediscard in error path
Syzbot reports a NULL pointer dereference issue as below:
refcountadd include/linux/refcount.h:193 [inline] refcountinc include/linux/refcount.h:250 [inline] refcountinc include/linux/refcount.h:267 [inline] gettaskstruct include/linux/sched/task.h:110 [inline] kthreadstop+0x34/0x1c0 kernel/kthread.c:703 f2fsstopdiscardthread+0x3c/0x5c fs/f2fs/segment.c:1638 killf2fssuper+0x5c/0x194 fs/f2fs/super.c:4522 deactivatelockedsuper+0x70/0xe8 fs/super.c:332 deactivatesuper+0xd0/0xd4 fs/super.c:363 cleanupmnt+0x1f8/0x234 fs/namespace.c:1186 cleanupmnt+0x20/0x30 fs/namespace.c:1193 taskworkrun+0xc4/0x14c kernel/taskwork.c:177 exittaskwork include/linux/taskwork.h:38 [inline] doexit+0x26c/0xbe0 kernel/exit.c:795 dogroupexit+0x60/0xe8 kernel/exit.c:925 dosysexitgroup kernel/exit.c:936 [inline] sesysexitgroup kernel/exit.c:934 [inline] wakeupparent+0x0/0x40 kernel/exit.c:934 invokesyscall arch/arm64/kernel/syscall.c:38 [inline] invokesyscall arch/arm64/kernel/syscall.c:52 [inline] el0svccommon+0x138/0x220 arch/arm64/kernel/syscall.c:142 doel0svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t64synchandler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t64sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
The root cause of this issue is in error path of f2fsstartdiscardthread(), it missed to invalidate dcc->f2fsissuediscard, later kthreadstop() may access invalid pointer.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-aws-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1033.37~20.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1035.42~20.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1031.38~20.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-69.76~20.04.1 - Upgrade
Upgrade
ubuntu/linux-intel-iotg-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1027.32~20.04.1 - Upgrade
Upgrade
ubuntu/linux-lowlatency-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-69.76~20.04.1 - Upgrade
Upgrade
ubuntu/linux-nvidia-tegra-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1014.14~20.04.1 - Upgrade
Upgrade
ubuntu/linux-oracle-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1032.38~20.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1030.34~20.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.15.0-69.76 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.15.0-1033.37 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.15.0-1035.42 - Upgrade
Upgrade
ubuntu/linux-azure-fdeto a version that resolves this vulnerability.Fixed in 5.15.0-1035.42.1 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.15.0-1031.38 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 5.15.0-1030.35 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.15.0-1017.22 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.15.0-1027.30 - Upgrade
Upgrade
ubuntu/linux-intel-iotgto a version that resolves this vulnerability.Fixed in 5.15.0-1027.32 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.15.0-1030.35 - Upgrade
Upgrade
ubuntu/linux-lowlatencyto a version that resolves this vulnerability.Fixed in 5.15.0-69.76 - Upgrade
Upgrade
ubuntu/linux-nvidiato a version that resolves this vulnerability.Fixed in 5.15.0-1023.23 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.15.0-1032.38 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.15.0-1026.28 - Upgrade
Upgrade
ubuntu/linux-bluefieldto a version that resolves this vulnerability.Fixed in 5.15.0-1015.17 - Upgrade
Upgrade
ubuntu/linux-intel-iot-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1023.28 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1034.37 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.116-1Fixed in 7.2.15-1Fixed in 7.3.4-1
Event History
Frequently Asked Questions
What is the severity of CVE-2022-50620?
CVE-2022-50620 is classified as a medium severity vulnerability due to its potential for causing system instability.
How do I fix CVE-2022-50620?
To address CVE-2022-50620, users should update their Linux kernel to the latest stable version that includes the fix.
What impact does CVE-2022-50620 have on systems?
CVE-2022-50620 can lead to a NULL pointer dereference, potentially resulting in crashes or unexpected behavior.
Which versions of the Linux kernel are affected by CVE-2022-50620?
CVE-2022-50620 affects multiple versions of the Linux kernel prior to the patches that resolve the vulnerability.
Is CVE-2022-50620 being actively exploited in the wild?
As of the latest information, there are no confirmed reports of active exploitation of CVE-2022-50620.