summaryrefslogtreecommitdiffstats
path: root/fs/fs_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fs_parser.c')
-rw-r--r--fs/fs_parser.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/fs_parser.c b/fs/fs_parser.c
index 460ea4206fa2..d1930adce68d 100644
--- a/fs/fs_parser.c
+++ b/fs/fs_parser.c
@@ -204,9 +204,23 @@ int fs_parse(struct fs_context *fc,
204 goto okay; 204 goto okay;
205 205
206 case fs_param_is_fd: { 206 case fs_param_is_fd: {
207 if (param->type != fs_value_is_file) 207 switch (param->type) {
208 case fs_value_is_string:
209 if (!result->has_value)
210 goto bad_value;
211
212 ret = kstrtouint(param->string, 0, &result->uint_32);
213 break;
214 case fs_value_is_file:
215 result->uint_32 = param->dirfd;
216 ret = 0;
217 default:
208 goto bad_value; 218 goto bad_value;
209 goto okay; 219 }
220
221 if (result->uint_32 > INT_MAX)
222 goto bad_value;
223 goto maybe_okay;
210 } 224 }
211 225
212 case fs_param_is_blockdev: 226 case fs_param_is_blockdev: