summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-ioctl.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2011-08-02 13:32:03 +0200
committerAlasdair G Kergon <agk@redhat.com>2011-08-02 13:32:03 +0200
commit2ca4c92f58f9386e080b26f9ccd78c9ca5825a42 (patch)
tree638f6e97f829cdf8cfc090dabff9213dc50db149 /drivers/md/dm-ioctl.c
parentdm raid: cleanup parameter handling (diff)
downloadlinux-2ca4c92f58f9386e080b26f9ccd78c9ca5825a42.tar.xz
linux-2ca4c92f58f9386e080b26f9ccd78c9ca5825a42.zip
dm ioctl: prevent empty message
Detect invalid empty messages in core dm instead of requiring every target to check this. Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r--drivers/md/dm-ioctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 4cacdad2270a..1622a6bc0bfd 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1402,6 +1402,11 @@ static int target_message(struct dm_ioctl *param, size_t param_size)
goto out;
}
+ if (!argc) {
+ DMWARN("Empty message received.");
+ goto out;
+ }
+
table = dm_get_live_table(md);
if (!table)
goto out_argv;