mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] fs: udf: parse_options: blocksize check
@ 2014-01-29  9:13 Fabian Frederick
  2014-01-30  0:11 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2014-01-29  9:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: jack, akpm, rdunlap, viro

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>
---
 fs/udf/super.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/udf/super.c b/fs/udf/super.c
index 3306b9f..ac76538 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -505,6 +505,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
 	while ((p = strsep(&options, ",")) != NULL) {
 		substring_t args[MAX_OPT_ARGS];
 		int token;
+		unsigned n;
 		if (!*p)
 			continue;
 
@@ -516,7 +517,10 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
 		case Opt_bs:
 			if (match_int(&args[0], &option))
 				return 0;
-			uopt->blocksize = option;
+			n = option;
+			if (n != 512 && n != 1024 && n != 2048 && n != 4096)
+				return 0;
+			uopt->blocksize = n;
 			uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET);
 			break;
 		case Opt_unhide:
-- 
1.8.1.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] fs: udf: parse_options: blocksize check
  2014-01-29  9:13 [PATCH 1/1] fs: udf: parse_options: blocksize check Fabian Frederick
@ 2014-01-30  0:11 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2014-01-30  0:11 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, jack, akpm, rdunlap, viro

On Wed 29-01-14 17:13:16, Fabian Frederick wrote:
> 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.
  Thanks. Merged into my tree.

							Honza

> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  fs/udf/super.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index 3306b9f..ac76538 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -505,6 +505,7 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
>  	while ((p = strsep(&options, ",")) != NULL) {
>  		substring_t args[MAX_OPT_ARGS];
>  		int token;
> +		unsigned n;
>  		if (!*p)
>  			continue;
>  
> @@ -516,7 +517,10 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
>  		case Opt_bs:
>  			if (match_int(&args[0], &option))
>  				return 0;
> -			uopt->blocksize = option;
> +			n = option;
> +			if (n != 512 && n != 1024 && n != 2048 && n != 4096)
> +				return 0;
> +			uopt->blocksize = n;
>  			uopt->flags |= (1 << UDF_FLAG_BLOCKSIZE_SET);
>  			break;
>  		case Opt_unhide:
> -- 
> 1.8.1.4
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-30  0:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-29  9:13 [PATCH 1/1] fs: udf: parse_options: blocksize check Fabian Frederick
2014-01-30  0:11 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®