mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
dm mpath: validate table argument count
The parser reads the argument count as a number but doesn't check that
sufficient arguments are supplied. This command triggers the bug:
dmsetup create mpath --table "0 `blockdev --getsize /dev/mapper/cr0`
multipath 0 0 2 1 round-robin 1000 0 1 1 /dev/mapper/cr0
round-robin 0 1 1 /dev/mapper/cr1 1000"
kernel BUG at drivers/md/dm-mpath.c:530!
Cc: [email protected]
Signed-off-by: Mikulas Patocka <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>
This commit is contained in:
parent
f234012f52
commit
0e0497c0c0
1 changed files with 6 additions and 0 deletions
|
|
@ -553,6 +553,12 @@ static int parse_path_selector(struct arg_set *as, struct priority_group *pg,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ps_argc > as->argc) {
|
||||
dm_put_path_selector(pst);
|
||||
ti->error = "not enough arguments for path selector";
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = pst->create(&pg->ps, ps_argc, as->argv);
|
||||
if (r) {
|
||||
dm_put_path_selector(pst);
|
||||
|
|
|
|||
Loading…
Reference in a new issue