Re: [PATCH V2 resend] FS/OMFS: block number sanity check during fill_super operation

From: Bob Copeland
Date: Mon Sep 29 2014 - 15:38:42 EST


On Mon, Sep 29, 2014 at 07:07:08PM +0200, Fabian Frederick wrote:
> This patch defines maximum block number to 2^31.
> It also converts bitmap_size and array_size to
> unsigned int in omfs_get_imap
>
> Suggested-By: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Suggested-By: Bob Copeland <me@xxxxxxxxxxxxxxx>
> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Cc: Bob Copeland <me@xxxxxxxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
> ---
> This is untested.

Acked-by: Bob Copeland <me@xxxxxxxxxxxxxxx>

I also gave it a quick test. For just plain corruption of s_num_blocks,
there's a later check that one would normally hit since the number is
stored in a second place, and we compare them. But if both
omfs_rb->r_num_blocks and sbi->s_num_blocks are the same insane number, I
agree we should give up here.

--
Bob Copeland %% www.bobcopeland.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/