瀏覽代碼

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>
Alasdair G Kergon 14 年之前
父節點
當前提交
2ca4c92f58
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      drivers/md/dm-ioctl.c

+ 5 - 0
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;