CVE-2022-50620

Source
https://cve.org/CVERecord?id=CVE-2022-50620
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50620.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-50620
Downstream
Published
2025-12-08T01:16:33.771Z
Modified
2026-04-02T08:28:39.210800Z
Summary
f2fs: fix to invalidate dcc->f2fs_issue_discard in error path
Details

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:

__refcount_add 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 __dosysexit_group kernel/exit.c:936 [inline] __sesysexit_group 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.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50620.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4d67490498acb4ffcef5ba7bc44990d46e66a44c
Fixed
865bb7b5a7deeb0e5afbd82381d52d38825dc64d
Fixed
a3e517a6ba695d683ee63615e1ea6e6b4c7d2732
Fixed
ae6c960a82c52c3bda5adc82d90643d6c12d308e
Fixed
91586ce0d39a05f88795aa8814fb99b1387236b3

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50620.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.15.0
Fixed
5.15.86
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.0.16
Type
ECOSYSTEM
Events
Introduced
6.1.0
Fixed
6.1.2

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50620.json"