All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mke2fs: don't accept too-high revision levels
@ 2014-05-01 19:55 Eric Sandeen
  2014-05-01 20:39 ` [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision Eric Sandeen
  2016-01-14 18:35 ` [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2014-05-01 19:55 UTC (permalink / raw)
  To: ext4 development

It's a bit strange to accept revision levels higher than
the code creating the filesystem can understand, so don't
allow it.

At least the kernel will mount the fs readonly if it's too
high, but no other utility will touch it, so you can't
fix the error.

Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index aecd5d5..82019dc 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1679,9 +1679,10 @@ profile_error:
 			break;
 		case 'r':
 			r_opt = strtoul(optarg, &tmp, 0);
-			if (*tmp) {
+			if (*tmp || (r_opt > EXT2_MAX_SUPP_REV)) {
 				com_err(program_name, 0,
-					_("bad revision level - %s"), optarg);
+					_("bad revision level - %s (max %d)"),
+					   optarg, EXT2_MAX_SUPP_REV);
 				exit(1);
 			}
 			fs_param.s_rev_level = r_opt;


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

* [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision
  2014-05-01 19:55 [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
@ 2014-05-01 20:39 ` Eric Sandeen
  2014-05-01 22:20   ` Andreas Dilger
  2014-05-01 22:35   ` [PATCH V3] " Eric Sandeen
  2016-01-14 18:35 ` [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
  1 sibling, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2014-05-01 20:39 UTC (permalink / raw)
  To: ext4 development, Frank Sorenson

From: Frank Sorenson <fsorenso@redhat.com>

Don't create a filesystem with an unsupported revision number

Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: Frank did this independently, and it's better.  I forgot about
using com_err here.

--- a/misc/mke2fs.c	
+++ a/misc/mke2fs.c	
@@ -1684,6 +1684,11 @@ profile_error:
 					_("bad revision level - %s"), optarg);
 				exit(1);
 			}
+			if (r_opt > EXT2_MAX_SUPP_REV) {
+				com_err(program_name, EXT2_ET_REV_TOO_HIGH,
+					_("while trying to create revision %d"), r_opt);
+				exit(1);
+			}
 			fs_param.s_rev_level = r_opt;
 			break;
 		case 's':	/* deprecated */

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

* Re: [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision
  2014-05-01 20:39 ` [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision Eric Sandeen
@ 2014-05-01 22:20   ` Andreas Dilger
  2014-05-01 22:35   ` [PATCH V3] " Eric Sandeen
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Dilger @ 2014-05-01 22:20 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, Frank Sorenson

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

On May 1, 2014, at 2:39 PM, Eric Sandeen <sandeen@redhat.com> wrote:

> From: Frank Sorenson <fsorenso@redhat.com>
> 
> Don't create a filesystem with an unsupported revision number

I like the commit comment on the original patch better...

Cheers, Andreas

> Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> V2: Frank did this independently, and it's better.  I forgot about
> using com_err here.
> 
> --- a/misc/mke2fs.c	
> +++ a/misc/mke2fs.c	
> @@ -1684,6 +1684,11 @@ profile_error:
> 					_("bad revision level - %s"), optarg);
> 				exit(1);
> 			}
> +			if (r_opt > EXT2_MAX_SUPP_REV) {
> +				com_err(program_name, EXT2_ET_REV_TOO_HIGH,
> +					_("while trying to create revision %d"), r_opt);
> +				exit(1);
> +			}
> 			fs_param.s_rev_level = r_opt;
> 			break;
> 		case 's':	/* deprecated */
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH V3] mke2fs: prevent creation of filesystem with unsupported revision
  2014-05-01 20:39 ` [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision Eric Sandeen
  2014-05-01 22:20   ` Andreas Dilger
@ 2014-05-01 22:35   ` Eric Sandeen
  2014-07-04 19:32     ` Theodore Ts'o
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2014-05-01 22:35 UTC (permalink / raw)
  To: ext4 development, Frank Sorenson

From: Frank Sorenson <fsorenso@redhat.com>

It's a bit strange to accept revision levels higher than
the code creating the filesystem can understand, so don't
allow it.

At least the kernel will mount the fs readonly if it's too
high, but no other utility will touch it, so you can't
fix the error.

Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.

Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
[sandeen@redhat.com: Add more verbose commit log]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: Frank did this independently, and it's better.  I forgot about
using com_err here.

V3: go back to V1's commit log for Andreas :)

--- a/misc/mke2fs.c	
+++ a/misc/mke2fs.c	
@@ -1684,6 +1684,11 @@ profile_error:
 					_("bad revision level - %s"), optarg);
 				exit(1);
 			}
+			if (r_opt > EXT2_MAX_SUPP_REV) {
+				com_err(program_name, EXT2_ET_REV_TOO_HIGH,
+					_("while trying to create revision %d"), r_opt);
+				exit(1);
+			}
 			fs_param.s_rev_level = r_opt;
 			break;
 		case 's':	/* deprecated */


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

* Re: [PATCH V3] mke2fs: prevent creation of filesystem with unsupported revision
  2014-05-01 22:35   ` [PATCH V3] " Eric Sandeen
@ 2014-07-04 19:32     ` Theodore Ts'o
  0 siblings, 0 replies; 7+ messages in thread
From: Theodore Ts'o @ 2014-07-04 19:32 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, Frank Sorenson

On Thu, May 01, 2014 at 05:35:00PM -0500, Eric Sandeen wrote:
> From: Frank Sorenson <fsorenso@redhat.com>
> 
> It's a bit strange to accept revision levels higher than
> the code creating the filesystem can understand, so don't
> allow it.
> 
> At least the kernel will mount the fs readonly if it's too
> high, but no other utility will touch it, so you can't
> fix the error.
> 
> Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.
> 
> Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
> [sandeen@redhat.com: Add more verbose commit log]
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Thanks, applied.

					- Ted

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

* Re: [PATCH] mke2fs: don't accept too-high revision levels
  2014-05-01 19:55 [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
  2014-05-01 20:39 ` [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision Eric Sandeen
@ 2016-01-14 18:35 ` Eric Sandeen
  2016-01-14 19:36   ` Andreas Dilger
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2016-01-14 18:35 UTC (permalink / raw)
  To: ext4 development

Came across this, still not merged, so ping?

On 5/1/14 2:55 PM, Eric Sandeen wrote:
> It's a bit strange to accept revision levels higher than
> the code creating the filesystem can understand, so don't
> allow it.
> 
> At least the kernel will mount the fs readonly if it's too
> high, but no other utility will touch it, so you can't
> fix the error.
> 
> Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index aecd5d5..82019dc 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -1679,9 +1679,10 @@ profile_error:
>  			break;
>  		case 'r':
>  			r_opt = strtoul(optarg, &tmp, 0);
> -			if (*tmp) {
> +			if (*tmp || (r_opt > EXT2_MAX_SUPP_REV)) {
>  				com_err(program_name, 0,
> -					_("bad revision level - %s"), optarg);
> +					_("bad revision level - %s (max %d)"),
> +					   optarg, EXT2_MAX_SUPP_REV);
>  				exit(1);
>  			}
>  			fs_param.s_rev_level = r_opt;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [PATCH] mke2fs: don't accept too-high revision levels
  2016-01-14 18:35 ` [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
@ 2016-01-14 19:36   ` Andreas Dilger
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Dilger @ 2016-01-14 19:36 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]


> On Jan 14, 2016, at 11:35 AM, Eric Sandeen <sandeen@redhat.com> wrote:
> 
> Came across this, still not merged, so ping?
> 
> On 5/1/14 2:55 PM, Eric Sandeen wrote:
>> It's a bit strange to accept revision levels higher than
>> the code creating the filesystem can understand, so don't
>> allow it.
>> 
>> At least the kernel will mount the fs readonly if it's too
>> high, but no other utility will touch it, so you can't
>> fix the error.
>> 
>> Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.
>> 
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

>> ---
>> 
>> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
>> index aecd5d5..82019dc 100644
>> --- a/misc/mke2fs.c
>> +++ b/misc/mke2fs.c
>> @@ -1679,9 +1679,10 @@ profile_error:
>> 			break;
>> 		case 'r':
>> 			r_opt = strtoul(optarg, &tmp, 0);
>> -			if (*tmp) {
>> +			if (*tmp || (r_opt > EXT2_MAX_SUPP_REV)) {
>> 				com_err(program_name, 0,
>> -					_("bad revision level - %s"), optarg);
>> +					_("bad revision level - %s (max %d)"),
>> +					   optarg, EXT2_MAX_SUPP_REV);
>> 				exit(1);
>> 			}
>> 			fs_param.s_rev_level = r_opt;
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2016-01-14 19:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01 19:55 [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
2014-05-01 20:39 ` [PATCH V2] mke2fs: prevent creation of filesystem with unsupported revision Eric Sandeen
2014-05-01 22:20   ` Andreas Dilger
2014-05-01 22:35   ` [PATCH V3] " Eric Sandeen
2014-07-04 19:32     ` Theodore Ts'o
2016-01-14 18:35 ` [PATCH] mke2fs: don't accept too-high revision levels Eric Sandeen
2016-01-14 19:36   ` Andreas Dilger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.