public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Andrey Albershteyn <aalbersh@redhat.com>
Cc: cem@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/5] xfs_io: init count to stop loop from execution
Date: Tue, 16 Apr 2024 09:15:30 -0700	[thread overview]
Message-ID: <20240416161530.GL11948@frogsfrogsfrogs> (raw)
In-Reply-To: <20240416123427.614899-4-aalbersh@redhat.com>

On Tue, Apr 16, 2024 at 02:34:25PM +0200, Andrey Albershteyn wrote:
> jdm_parentpaths() doesn't initialize count. If count happens to be
> non-zero, following loop can result in access overflow.
> 
> Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
> ---
>  io/parent.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/io/parent.c b/io/parent.c
> index 8f63607ffec2..5750d98a3b75 100644
> --- a/io/parent.c
> +++ b/io/parent.c
> @@ -112,7 +112,7 @@ check_parents(parent_t *parentbuf, size_t *parentbuf_size,

check_parents is an artifact of the old sgi parent pointers code and
(apparently) its need to check parent pointer correctness via xfs_io
commands.  The Linux parent pointers patchset fixed all those
referential integrity problems (thanks, Allison!) and will blow this
away, so I think we should ignore this report:

https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfsprogs-dev.git/commit/io/parent.c?h=pptrs&id=c0854b85c1e8c90ea3eea930a20d1323e61ddb40

--D

>  	     jdm_fshandle_t *fshandlep, struct xfs_bstat *statp)
>  {
>  	int error, i;
> -	__u32 count;
> +	__u32 count = 0;
>  	parent_t *entryp;
>  
>  	do {
> -- 
> 2.42.0
> 
> 

  reply	other threads:[~2024-04-16 16:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 12:34 [PATCH 0/5] xfsprogs random fixes found by Coverity scan Andrey Albershteyn
2024-04-16 12:34 ` [PATCH 1/5] xfs_db: fix leak in flist_find_ftyp() Andrey Albershteyn
2024-04-16 16:07   ` Darrick J. Wong
2024-04-16 16:32   ` Christoph Hellwig
2024-04-16 12:34 ` [PATCH 2/5] xfs_repair: make duration take time_t Andrey Albershteyn
2024-04-16 16:12   ` Darrick J. Wong
2024-04-16 16:20     ` Andrey Albershteyn
2024-04-16 16:45   ` Christoph Hellwig
2024-04-16 12:34 ` [PATCH 3/5] xfs_io: init count to stop loop from execution Andrey Albershteyn
2024-04-16 16:15   ` Darrick J. Wong [this message]
2024-04-16 16:22     ` Andrey Albershteyn
2024-04-16 12:34 ` [PATCH 4/5] xfs_scrub: don't call phase_end if phase_rusage was not initialized Andrey Albershteyn
2024-04-16 16:18   ` Darrick J. Wong
2024-04-16 12:34 ` [PATCH 5/5] xfs_fsr: convert fsrallfs to use time_t instead of int Andrey Albershteyn
2024-04-16 16:21   ` Darrick J. Wong
2024-04-16 16:31     ` Andrey Albershteyn
2024-04-16 17:07       ` Darrick J. Wong
2024-04-16 16:39     ` Eric Sandeen
2024-04-16 16:41       ` Christoph Hellwig

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=20240416161530.GL11948@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@redhat.com \
    --cc=cem@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox