mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 08:35:19 -05:00
dm flakey: check for null arg_name in parse_features()
One can crash dm-flakey by specifying more feature arguments than the number of features supplied. Checking for null in arg_name avoids this. dmsetup create flakey-test --table "0 66076080 flakey /dev/sdb9 0 0 180 2 drop_writes" Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
parent
7efd5fed6f
commit
7690e25302
1 changed files with 5 additions and 0 deletions
|
@ -70,6 +70,11 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc,
|
||||||
arg_name = dm_shift_arg(as);
|
arg_name = dm_shift_arg(as);
|
||||||
argc--;
|
argc--;
|
||||||
|
|
||||||
|
if (!arg_name) {
|
||||||
|
ti->error = "Insufficient feature arguments";
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* drop_writes
|
* drop_writes
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue