Linux filesystem development
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] quota: Detect loops in quota tree
Date: Mon, 12 Feb 2024 10:47:28 -0800	[thread overview]
Message-ID: <202402121046.42785619B@keescook> (raw)
In-Reply-To: <20240209112250.10894-1-jack@suse.cz>

On Fri, Feb 09, 2024 at 12:22:50PM +0100, Jan Kara wrote:
> [...]
> @@ -613,15 +658,17 @@ static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info,
>  
>  /* Find entry for given id in the tree */
>  static loff_t find_tree_dqentry(struct qtree_mem_dqinfo *info,
> -				struct dquot *dquot, uint blk, int depth)
> +				struct dquot *dquot, uint *blks, int depth)
>  {
>  	char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
>  	loff_t ret = 0;
>  	__le32 *ref = (__le32 *)buf;
> +	uint blk;
> +	int i;
>  
>  	if (!buf)
>  		return -ENOMEM;
> -	ret = read_blk(info, blk, buf);
> +	ret = read_blk(info, blks[depth], buf);
>  	if (ret < 0) {
>  		quota_error(dquot->dq_sb, "Can't read quota tree block %u",
>  			    blk);
                            ^^^
Coverity noticed this is used uninitialized. It should be "blks[depth]"
now, I think.

-Kees

-- 
Kees Cook

  reply	other threads:[~2024-02-12 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 11:22 [PATCH] quota: Detect loops in quota tree Jan Kara
2024-02-12 18:47 ` Kees Cook [this message]
2024-02-12 23:48   ` Jan Kara
2024-02-12 23:59     ` Kees Cook

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=202402121046.42785619B@keescook \
    --to=keescook@chromium.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox