CVE-2022-49993

Source
https://cve.org/CVERecord?id=CVE-2022-49993
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49993.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49993
Downstream
Related
Published
2025-06-18T11:00:53.487Z
Modified
2026-05-15T11:53:10.226624097Z
Summary
loop: Check for overflow while configuring loop
Details

In the Linux kernel, the following vulnerability has been resolved:

loop: Check for overflow while configuring loop

The userspace can configure a loop using an ioctl call, wherein a configuration of type loopconfig is passed (see loioctl()'s case on line 1550 of drivers/block/loop.c). This proceeds to call loopconfigure() which in turn calls loopsetstatusfrominfo() (see line 1050 of loop.c), passing &config->info which is of type loopinfo64*. This function then sets the appropriate values, like the offset.

loopdevice has looffset of type lofft (see line 52 of loop.c), which is typdef-chained to long long, whereas loopinfo64 has lo_offset of type __u64 (see line 56 of include/uapi/linux/loop.h).

The function directly copies offset from info to the device as follows (See line 980 of loop.c): lo->looffset = info->looffset;

This results in an overflow, which triggers a warning in iomapiter() due to a call to iomapiterdone() which has: WARNON_ONCE(iter->iomap.offset > iter->pos);

Thus, check for negative value during loopsetstatusfrominfo().

Bug report: https://syzkaller.appspot.com/bug?id=c620fe14aac810396d3c3edc9ad73848bf69a29e

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

Affected packages

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.6.12
Fixed
4.9.327
Type
ECOSYSTEM
Events
Introduced
4.10.0
Fixed
4.14.292
Type
ECOSYSTEM
Events
Introduced
4.15.0
Fixed
4.19.312
Type
ECOSYSTEM
Events
Introduced
4.20.0
Fixed
5.4.274
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.140
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.64
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.19.6

Database specific

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