Skip to content

Commit 7690e25

Browse files
goldwynrsnitm
authored andcommitted
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 <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 7efd5fe commit 7690e25

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/md/dm-flakey.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc,
7070
arg_name = dm_shift_arg(as);
7171
argc--;
7272

73+
if (!arg_name) {
74+
ti->error = "Insufficient feature arguments";
75+
return -EINVAL;
76+
}
77+
7378
/*
7479
* drop_writes
7580
*/

0 commit comments

Comments
 (0)