This repository has been archived by the owner on Nov 21, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 562d7b1 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. Reported-by: [email protected] Fixes: 562d7b1 ("btrfs: handle device lookup with btrfs_dev_lookup_args") CC: [email protected] # 5.16+ Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Liu Shixin <[email protected]> Signed-off-by: David Sterba <[email protected]>
- Loading branch information