CVE-2022-49993

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49993
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49993.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49993
Downstream
Related
Published
2025-06-18T11:15:26Z
Modified
2025-08-09T19:01:28Z
Summary
[none]
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 looffset 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

References

Affected packages