btrfs: fix match incorrectly in dev_args_match_device
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
05.15.796.0.96.1In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix match incorrectly in dev_args_match_device
syzkaller found a failed assertion:
assertion failed: (args->devid != (u64)-1) || args->missing, in fs/btrfs/volumes.c:6921
This can be triggered when we set devid to (u64)-1 by ioctl. In this case, the match of devid will be skipped and the match of device may succeed incorrectly.
Patch 562d7b1512f7 introduced this function which is used to match device. This function contains two matching scenarios, we can distinguish them by checking the value of args->missing rather than check whether args->devid and args->uuid is default value.
From the CVE record · Linux
The Linux kernel’s btrfs device-matching function can incorrectly match a device when an ioctl sets the device ID to (u64)-1. A local caller able to issue that ioctl can trigger a failed kernel assertion; the input does not specify authentication requirements.
Engineers running Linux kernels with btrfs should check their systems; affected versions are not specified.