diff options
-rw-r--r-- | fs/autofs4/dev-ioctl.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c index aa3f47293bb8..025e105bffea 100644 --- a/fs/autofs4/dev-ioctl.c +++ b/fs/autofs4/dev-ioctl.c | |||
@@ -124,7 +124,7 @@ static inline void free_dev_ioctl(struct autofs_dev_ioctl *param) | |||
124 | 124 | ||
125 | /* | 125 | /* |
126 | * Check sanity of parameter control fields and if a path is present | 126 | * Check sanity of parameter control fields and if a path is present |
127 | * check that it has a "/" and is terminated. | 127 | * check that it is terminated and contains at least one "/". |
128 | */ | 128 | */ |
129 | static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param) | 129 | static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param) |
130 | { | 130 | { |
@@ -138,15 +138,16 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | if (param->size > sizeof(*param)) { | 140 | if (param->size > sizeof(*param)) { |
141 | err = check_name(param->path); | 141 | err = invalid_str(param->path, |
142 | (void *) ((size_t) param + param->size)); | ||
142 | if (err) { | 143 | if (err) { |
143 | AUTOFS_WARN("invalid path supplied for cmd(0x%08x)", | 144 | AUTOFS_WARN( |
144 | cmd); | 145 | "path string terminator missing for cmd(0x%08x)", |
146 | cmd); | ||
145 | goto out; | 147 | goto out; |
146 | } | 148 | } |
147 | 149 | ||
148 | err = invalid_str(param->path, | 150 | err = check_name(param->path); |
149 | (void *) ((size_t) param + param->size)); | ||
150 | if (err) { | 151 | if (err) { |
151 | AUTOFS_WARN("invalid path supplied for cmd(0x%08x)", | 152 | AUTOFS_WARN("invalid path supplied for cmd(0x%08x)", |
152 | cmd); | 153 | cmd); |