Skip to content

Commit 8c6915a

Browse files
Fabian Frederickjankara
authored andcommitted
fs: udf: parse_options: blocksize check
Both affs and isofs check for blocksize integrity during parse_options.Do the same thing for udf. Valid values : 512, 1024, 2048 or 4096 bytes. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 0414855 commit 8c6915a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎fs/udf/super.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
505505
while ((p = strsep(&options, ",")) != NULL) {
506506
substring_t args[MAX_OPT_ARGS];
507507
int token;
508+
unsigned n;
508509
if (!*p)
509510
continue;
510511

@@ -516,7 +517,10 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
516517
case Opt_bs:
517518
if (match_int(&args[0], &option))
518519
return 0;
519-
uopt->blocksize = option;
520+
n = option;
521+
if (n != 512 && n != 1024 && n != 2048 && n != 4096)
522+
return 0;
523+
uopt->blocksize = n;
520524
uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET);
521525
break;
522526
case Opt_unhide:

0 commit comments

Comments
 (0)