All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.10.y] [FIX BAD BACKPORT] Btrfs: add missing brelse when superblock checksum fails
@ 2018-01-16 16:25 Jeff Mahoney
  2018-01-16 16:58 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Mahoney @ 2018-01-16 16:25 UTC (permalink / raw)
  To: stable; +Cc: Anand Jain

Commit b2acdddfad13c38a1e8b927d83c3cf321f63601a upstream.

linux-3.10.y commit bf00d124e07 (Btrfs: add missing brelse when
superblock checksum fails) was misapplied to a later error handling
site.  The result is that it doesn't actually free the buffer on
checksum failure but does attempt to double free the buffer if
unsupported features are used.

The backport of b2acdddfad1 in other branches is correct.

Cc: <stable@vger.kernel.org> # 3.10
Cc: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/btrfs/disk-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 9612a01198df..c690886f2813 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2311,6 +2311,7 @@ int open_ctree(struct super_block *sb,
 	if (btrfs_check_super_csum(bh->b_data)) {
 		printk(KERN_ERR "btrfs: superblock checksum mismatch\n");
 		err = -EINVAL;
+		brelse(bh);
 		goto fail_alloc;
 	}
 
@@ -2437,7 +2438,6 @@ int open_ctree(struct super_block *sb,
 		       "unsupported option features (%Lx).\n",
 		       (unsigned long long)features);
 		err = -EINVAL;
-		brelse(bh);
 		goto fail_alloc;
 	}
 
-- 
2.14.2


-- 
Jeff Mahoney
SUSE Labs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3.10.y] [FIX BAD BACKPORT] Btrfs: add missing brelse when superblock checksum fails
  2018-01-16 16:25 [PATCH 3.10.y] [FIX BAD BACKPORT] Btrfs: add missing brelse when superblock checksum fails Jeff Mahoney
@ 2018-01-16 16:58 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2018-01-16 16:58 UTC (permalink / raw)
  To: Jeff Mahoney; +Cc: stable, Anand Jain

On Tue, Jan 16, 2018 at 11:25:17AM -0500, Jeff Mahoney wrote:
> Commit b2acdddfad13c38a1e8b927d83c3cf321f63601a upstream.
> 
> linux-3.10.y commit bf00d124e07 (Btrfs: add missing brelse when
> superblock checksum fails) was misapplied to a later error handling
> site.  The result is that it doesn't actually free the buffer on
> checksum failure but does attempt to double free the buffer if
> unsupported features are used.
> 
> The backport of b2acdddfad1 in other branches is correct.
> 
> Cc: <stable@vger.kernel.org> # 3.10
> Cc: Anand Jain <anand.jain@oracle.com>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
> ---
>  fs/btrfs/disk-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

3.10 is long obsolete, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-16 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-16 16:25 [PATCH 3.10.y] [FIX BAD BACKPORT] Btrfs: add missing brelse when superblock checksum fails Jeff Mahoney
2018-01-16 16:58 ` Greg KH

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.