2014-07-17 21:12:00

by Eric Sandeen

[permalink] [raw]
Subject: [PATCH] e2fsck: free bh on csum verify error in do_one_pass

Coverity (re-)spotted this; it was triaged as a false positive,
but it seems pretty clear that the bh (which was just checked)
isn't currently freed before the function exits.

Signed-off-by: Eric Sandeen <[email protected]>
---

diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c
index 54579c2..66d02b2 100644
--- a/e2fsck/recovery.c
+++ b/e2fsck/recovery.c
@@ -523,6 +523,7 @@ static int do_one_pass(journal_t *journal,
!jbd2_descr_block_csum_verify(journal,
bh->b_data)) {
err = -EIO;
+ brelse(bh);
goto failed;
}




2014-07-18 09:04:48

by Lukas Czerner

[permalink] [raw]
Subject: Re: [PATCH] e2fsck: free bh on csum verify error in do_one_pass

On Thu, 17 Jul 2014, Eric Sandeen wrote:

> Date: Thu, 17 Jul 2014 16:11:59 -0500
> From: Eric Sandeen <[email protected]>
> To: ext4 development <[email protected]>
> Subject: [PATCH] e2fsck: free bh on csum verify error in do_one_pass
>
> Coverity (re-)spotted this; it was triaged as a false positive,
> but it seems pretty clear that the bh (which was just checked)
> isn't currently freed before the function exits.

Looks good.

Reviewed-by: Lukas Czerner <[email protected]>

Thanks!
-Lukas


>
> Signed-off-by: Eric Sandeen <[email protected]>
> ---
>
> diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c
> index 54579c2..66d02b2 100644
> --- a/e2fsck/recovery.c
> +++ b/e2fsck/recovery.c
> @@ -523,6 +523,7 @@ static int do_one_pass(journal_t *journal,
> !jbd2_descr_block_csum_verify(journal,
> bh->b_data)) {
> err = -EIO;
> + brelse(bh);
> goto failed;
> }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2014-07-22 20:35:07

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] e2fsck: free bh on csum verify error in do_one_pass

On Fri, Jul 18, 2014 at 11:04:45AM +0200, Lukáš Czerner wrote:
> On Thu, 17 Jul 2014, Eric Sandeen wrote:
>
> > Date: Thu, 17 Jul 2014 16:11:59 -0500
> > From: Eric Sandeen <[email protected]>
> > To: ext4 development <[email protected]>
> > Subject: [PATCH] e2fsck: free bh on csum verify error in do_one_pass
> >
> > Coverity (re-)spotted this; it was triaged as a false positive,
> > but it seems pretty clear that the bh (which was just checked)
> > isn't currently freed before the function exits.
>
> Looks good.
>
> Reviewed-by: Lukas Czerner <[email protected]>

Thanks, applied.

- Ted