On Wed, May 13, 2015 at 05:15:35PM +0800, Qu Wenruo wrote:
> Now btrfs-progs will have much more restrict superblock check based on
> kernel superblock check.
>
> This should at least provide some hostile crafted image to crash command
> like btrfsck.
>
> Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
Applied with some changes.
> +/* Just to save some space */
> +#define pr_err(fmt, args...) (fprintf(stderr, fmt, ##args))
fprintf(stderr, ...)
> + /*
> + * Hint to catch really bogus numbers, bitflips or so
> + */
> + if (btrfs_super_num_devices(sb) > (1UL << 31)) {
> + pr_err("ERROR: suspicious number of devices: %llu\n",
> + btrfs_super_num_devices(sb));
> + return -EIO;
This is supposed to be only a warning.
> + }
> +
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html