In the Linux kernel, the following vulnerability has been resolved:
erofs/zmap.c: Fix incorrect offset calculation
Effective offset to add to length was being incorrectly calculated, which resulted in iomap->length being set to 0, triggering a WARNON in iomapiter_done().
Fix that, and describe it in comments.
This was reported as a crash by syzbot under an issue about a warning encountered in iomapiterdone(), but unrelated to erofs.
C reproducer: https://syzkaller.appspot.com/text?tag=ReproC&x=1037a6b2880000 Kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=e2021a61197ebe02 Dashboard link: https://syzkaller.appspot.com/bug?extid=a8e049cd3abd342936b6
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49747.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49747.json"
[
{
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "z_erofs_iomap_begin_report",
"file": "fs/erofs/zmap.c"
},
"digest": {
"function_hash": "224919707708634736366603734207976690476",
"length": 741.0
},
"id": "CVE-2022-49747-099f0501",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6acd87d50998ef0afafc441613aeaf5a8f5c9eff",
"signature_version": "v1"
},
{
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "z_erofs_iomap_begin_report",
"file": "fs/erofs/zmap.c"
},
"digest": {
"function_hash": "224919707708634736366603734207976690476",
"length": 741.0
},
"id": "CVE-2022-49747-13dbaa8f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9f31d8c889d9a4e47bfcc6c4537d0c9f89fe582c",
"signature_version": "v1"
},
{
"deprecated": false,
"signature_type": "Function",
"target": {
"function": "z_erofs_iomap_begin_report",
"file": "fs/erofs/zmap.c"
},
"digest": {
"function_hash": "127240833083311060774501768254789325216",
"length": 705.0
},
"id": "CVE-2022-49747-6f29cb92",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2144859229c1e74f52d3ea067338d314a83a8afb",
"signature_version": "v1"
},
{
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "fs/erofs/zmap.c"
},
"digest": {
"line_hashes": [
"294724924377778887798820716684120075055",
"210237207576834654378179616779267810867",
"259844733387737211884121662055734692163",
"55434434106509689286809582297567959385",
"292829791133855522515928257949270677233"
],
"threshold": 0.9
},
"id": "CVE-2022-49747-8900f16c",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9f31d8c889d9a4e47bfcc6c4537d0c9f89fe582c",
"signature_version": "v1"
},
{
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "fs/erofs/zmap.c"
},
"digest": {
"line_hashes": [
"294724924377778887798820716684120075055",
"210237207576834654378179616779267810867",
"259844733387737211884121662055734692163",
"55434434106509689286809582297567959385",
"292829791133855522515928257949270677233"
],
"threshold": 0.9
},
"id": "CVE-2022-49747-b828237b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2144859229c1e74f52d3ea067338d314a83a8afb",
"signature_version": "v1"
},
{
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "fs/erofs/zmap.c"
},
"digest": {
"line_hashes": [
"294724924377778887798820716684120075055",
"210237207576834654378179616779267810867",
"259844733387737211884121662055734692163",
"55434434106509689286809582297567959385",
"292829791133855522515928257949270677233"
],
"threshold": 0.9
},
"id": "CVE-2022-49747-ef80e7c1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6acd87d50998ef0afafc441613aeaf5a8f5c9eff",
"signature_version": "v1"
}
]