In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to do sanity check on curseg->alloc_type
As Wenqing Liu reported in bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=215657
Overview UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2 when mount and operate a corrupted image
Reproduce tested on kernel 5.17-rc4, 5.17-rc6
The root cause is we missed to do sanity check on curseg->alloctype, result in out-of-bound accessing on sbi->blockcount[] array, fix it.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49170.json",
"cna_assigner": "Linux"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49170.json"
[
{
"id": "CVE-2022-49170-1a9ac9df",
"digest": {
"line_hashes": [
"125037466769412603611892722689196968580",
"31280801685353181003669148493616420491",
"224881338185054825678590352434737777868"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f68caedf264a95c0b02dfd0d9f92ac2637d5848a",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c"
}
},
{
"id": "CVE-2022-49170-69a80d24",
"digest": {
"line_hashes": [
"120952476039336894013159334001230539390",
"149905902320396906693274339061822612067",
"224881338185054825678590352434737777868"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@498b7088db71f9707359448cd6800bbb1882f4c3",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c"
}
},
{
"id": "CVE-2022-49170-6ca5e3ca",
"digest": {
"function_hash": "204665229547502981925445953349196578340",
"length": 855.0
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c12765e3f129b144421c80d3383df885f85ee290",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c",
"function": "sanity_check_curseg"
}
},
{
"id": "CVE-2022-49170-75c3bdd1",
"digest": {
"function_hash": "204665229547502981925445953349196578340",
"length": 855.0
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f41ee8b91c00770d718be2ff4852a80017ae9ab3",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c",
"function": "sanity_check_curseg"
}
},
{
"id": "CVE-2022-49170-87e34321",
"digest": {
"line_hashes": [
"125037466769412603611892722689196968580",
"31280801685353181003669148493616420491",
"224881338185054825678590352434737777868"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f41ee8b91c00770d718be2ff4852a80017ae9ab3",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c"
}
},
{
"id": "CVE-2022-49170-a24d5b24",
"digest": {
"function_hash": "5621030566992158023042850511483346154",
"length": 766.0
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@498b7088db71f9707359448cd6800bbb1882f4c3",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c",
"function": "sanity_check_curseg"
}
},
{
"id": "CVE-2022-49170-a746657b",
"digest": {
"line_hashes": [
"125037466769412603611892722689196968580",
"31280801685353181003669148493616420491",
"224881338185054825678590352434737777868"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0748a0f7dcb9d9dddc80302d73ebcecef6782ef0",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c"
}
},
{
"id": "CVE-2022-49170-cb5578c3",
"digest": {
"function_hash": "204665229547502981925445953349196578340",
"length": 855.0
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0748a0f7dcb9d9dddc80302d73ebcecef6782ef0",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c",
"function": "sanity_check_curseg"
}
},
{
"id": "CVE-2022-49170-ce0fb0b4",
"digest": {
"function_hash": "204665229547502981925445953349196578340",
"length": 855.0
},
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f68caedf264a95c0b02dfd0d9f92ac2637d5848a",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c",
"function": "sanity_check_curseg"
}
},
{
"id": "CVE-2022-49170-d63a4c55",
"digest": {
"line_hashes": [
"125037466769412603611892722689196968580",
"31280801685353181003669148493616420491",
"224881338185054825678590352434737777868"
],
"threshold": 0.9
},
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c12765e3f129b144421c80d3383df885f85ee290",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "fs/f2fs/segment.c"
}
}
]