Re: [PATCH] btrfs-progs: sanity check global roots key.offset

David Sterba
2022-02-09T15:29:13Z

On Tue, Feb 08, 2022 at 02:30:05PM -0500, Josef Bacik wrote:
> For !extent tree v2 we should validate the key.offset == 0, and for
> extent tree v2 we should validate that key.offset < nr_global_roots. If
> this fails we need to fail to load the global root so that the
> appropriate action is taken.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
> Dave, this fixes GH issue https://github.com/kdave/btrfs-progs/issues/446, the
> problem was we weren't catching that nr_global_roots was incorrect and then
> segfaulting later. I think I sent this as part of a series, but it stands
> alone.

Thanks, I think I've merged all the prep stuff, in kernel and in progs
too, so I'll do another batch for 5.17.