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; }
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
linux-stable-mirror@lists.linaro.org