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
[
{
"id": "CVE-2022-49747-099f0501",
"target": {
"function": "z_erofs_iomap_begin_report",
"file": "fs/erofs/zmap.c"
},
"digest": {
"length": 741.0,
"function_hash": "224919707708634736366603734207976690476"
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6acd87d50998ef0afafc441613aeaf5a8f5c9eff",
"signature_type": "Function"
},
{
"id": "CVE-2022-49747-13dbaa8f",
"target": {
"function": "z_erofs_iomap_begin_report",
"file": "fs/erofs/zmap.c"
},
"digest": {
"length": 741.0,
"function_hash": "224919707708634736366603734207976690476"
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9f31d8c889d9a4e47bfcc6c4537d0c9f89fe582c",
"signature_type": "Function"
},
{
"id": "CVE-2022-49747-6f29cb92",
"target": {
"function": "z_erofs_iomap_begin_report",
"file": "fs/erofs/zmap.c"
},
"digest": {
"length": 705.0,
"function_hash": "127240833083311060774501768254789325216"
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2144859229c1e74f52d3ea067338d314a83a8afb",
"signature_type": "Function"
},
{
"id": "CVE-2022-49747-8900f16c",
"target": {
"file": "fs/erofs/zmap.c"
},
"digest": {
"line_hashes": [
"294724924377778887798820716684120075055",
"210237207576834654378179616779267810867",
"259844733387737211884121662055734692163",
"55434434106509689286809582297567959385",
"292829791133855522515928257949270677233"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9f31d8c889d9a4e47bfcc6c4537d0c9f89fe582c",
"signature_type": "Line"
},
{
"id": "CVE-2022-49747-b828237b",
"target": {
"file": "fs/erofs/zmap.c"
},
"digest": {
"line_hashes": [
"294724924377778887798820716684120075055",
"210237207576834654378179616779267810867",
"259844733387737211884121662055734692163",
"55434434106509689286809582297567959385",
"292829791133855522515928257949270677233"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2144859229c1e74f52d3ea067338d314a83a8afb",
"signature_type": "Line"
},
{
"id": "CVE-2022-49747-ef80e7c1",
"target": {
"file": "fs/erofs/zmap.c"
},
"digest": {
"line_hashes": [
"294724924377778887798820716684120075055",
"210237207576834654378179616779267810867",
"259844733387737211884121662055734692163",
"55434434106509689286809582297567959385",
"292829791133855522515928257949270677233"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6acd87d50998ef0afafc441613aeaf5a8f5c9eff",
"signature_type": "Line"
}
]