summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorBlazej Kucman <blazej.kucman@intel.com>2021-12-03 15:31:15 +0100
committerJes Sorensen <jsorensen@fb.com>2021-12-08 15:39:50 +0100
commitced5fa8b170ad448f4076e24a10c731b5cfb36ce (patch)
tree3d9bb069b988bb06da8445291076efcf31aebde6 /mdadm.h
parentCorrect checking if file descriptors are valid (diff)
downloadmdadm-ced5fa8b170ad448f4076e24a10c731b5cfb36ce.tar.xz
mdadm-ced5fa8b170ad448f4076e24a10c731b5cfb36ce.zip
mdadm: block creation with long names
This fixes buffer overflows in create_mddev(). It prohibits creation with not supported names for DDF and native. For IMSM, mdadm will do silent cut to 16 later. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Blazej Kucman <blazej.kucman@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/mdadm.h b/mdadm.h
index 54567396..c7268a71 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1880,3 +1880,8 @@ enum r0layout {
#define INVALID_SECTORS 1
/* And another special number needed for --data_offset=variable */
#define VARIABLE_OFFSET 3
+
+/**
+ * This is true for native and DDF, IMSM allows 16.
+ */
+#define MD_NAME_MAX 32