All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: dabtree scrub needs to range-check level
Date: Tue, 19 Mar 2019 09:00:16 -0400	[thread overview]
Message-ID: <20190319130015.GA23863@bfoster> (raw)
In-Reply-To: <20190318164215.GN4929@magnolia>

On Mon, Mar 18, 2019 at 09:42:15AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Make sure scrub's dabtree iterator function checks that we're not
> going deeper in the stack than our cursor permits.  Found by sparse.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/scrub/dabtree.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
> index c6ab123b6051..5c6175d074e0 100644
> --- a/fs/xfs/scrub/dabtree.c
> +++ b/fs/xfs/scrub/dabtree.c
> @@ -604,6 +604,11 @@ xchk_da_btree(
>  		/* Drill another level deeper. */
>  		blkno = be32_to_cpu(key->before);
>  		level++;
> +		if (level >= XFS_DA_NODE_MAXDEPTH) {
> +			/* Too deep! */
> +			xchk_da_set_corrupt(&ds, level - 1);
> +			break;
> +		}
>  		ds.tree_level--;
>  		error = xchk_da_btree_block(&ds, level, blkno);
>  		if (error)

      reply	other threads:[~2019-03-19 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 16:42 [PATCH] xfs: dabtree scrub needs to range-check level Darrick J. Wong
2019-03-19 13:00 ` Brian Foster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190319130015.GA23863@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.