In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to do sanity check on inline_dots inode
As Wenqing reported in bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=215765
It will cause a kernel panic with steps: - mkdir mnt - mount tmp40.img mnt - ls mnt
foliomarkdirty+0x33/0x50 f2fsaddregularentry+0x541/0xad0 [f2fs] f2fsadddentry+0x6c/0xb0 [f2fs] f2fsdoaddlink+0x182/0x230 [f2fs] _recoverdotdentries+0x2d6/0x470 [f2fs] f2fslookup+0x5af/0x6a0 [f2fs] _lookupslow+0xac/0x200 lookupslow+0x45/0x70 walkcomponent+0x16c/0x250 pathlookupat+0x8b/0x1f0 filenamelookup+0xef/0x250 userpathatempty+0x46/0x70 vfsstatx+0x98/0x190 _dosysnewlstat+0x41/0x90 _x64sysnewlstat+0x1a/0x30 dosyscall64+0x37/0xb0 entrySYSCALL64afterhwframe+0x44/0xae
The root cause is for special file: e.g. character, block, fifo or socket file, f2fs doesn't assign address space operations pointer array for mapping->aops field, so, in a fuzzed image, if inlinedots flag was tagged in special file, during lookup(), when f2fs runs into _recoverdotdentries(), it will cause NULL pointer access once f2fsaddregularentry() calls aops->setdirty_page().
[
{
"id": "CVE-2022-49428-064b9d5a",
"target": {
"function": "__recover_dot_dentries",
"file": "fs/f2fs/namei.c"
},
"digest": {
"length": 1007.0,
"function_hash": "81601999304539231709115349550144893863"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@34f48ce5d5936eea33e3b6415403e57eb84aff97"
},
{
"id": "CVE-2022-49428-09da21ca",
"target": {
"function": "__recover_dot_dentries",
"file": "fs/f2fs/namei.c"
},
"digest": {
"length": 1007.0,
"function_hash": "81601999304539231709115349550144893863"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@250e5a6be52a6b9d82fe91976c83cc158868b4e9"
},
{
"id": "CVE-2022-49428-3486784b",
"target": {
"file": "fs/f2fs/namei.c"
},
"digest": {
"line_hashes": [
"56095138770149030204308698185984094048",
"268039015547462606974100678873916135056",
"114773279166811794122586389572479638925"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@250e5a6be52a6b9d82fe91976c83cc158868b4e9"
},
{
"id": "CVE-2022-49428-39f72709",
"target": {
"file": "fs/f2fs/namei.c"
},
"digest": {
"line_hashes": [
"56095138770149030204308698185984094048",
"268039015547462606974100678873916135056",
"114773279166811794122586389572479638925"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@34f48ce5d5936eea33e3b6415403e57eb84aff97"
},
{
"id": "CVE-2022-49428-6b9ed4d4",
"target": {
"file": "fs/f2fs/namei.c"
},
"digest": {
"line_hashes": [
"56095138770149030204308698185984094048",
"268039015547462606974100678873916135056",
"114773279166811794122586389572479638925"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2f46160d0a19b13bfe96c0dd50eed5c5d253ab7a"
},
{
"id": "CVE-2022-49428-798c1b17",
"target": {
"function": "__recover_dot_dentries",
"file": "fs/f2fs/namei.c"
},
"digest": {
"length": 1007.0,
"function_hash": "81601999304539231709115349550144893863"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2f46160d0a19b13bfe96c0dd50eed5c5d253ab7a"
},
{
"id": "CVE-2022-49428-b44e3865",
"target": {
"function": "__recover_dot_dentries",
"file": "fs/f2fs/namei.c"
},
"digest": {
"length": 1007.0,
"function_hash": "81601999304539231709115349550144893863"
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@12662d19467b391b5b509ac5e9ab4f583c6dde16"
},
{
"id": "CVE-2022-49428-cbf73a51",
"target": {
"file": "fs/f2fs/namei.c"
},
"digest": {
"line_hashes": [
"56095138770149030204308698185984094048",
"268039015547462606974100678873916135056",
"114773279166811794122586389572479638925"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@12662d19467b391b5b509ac5e9ab4f583c6dde16"
}
]