lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 15 May 2020 10:17:40 +0800
From:   Bo YU <tsu.yubo@...il.com>
To:     clm@...com, josef@...icpanda.com, sterba@...e.com
Cc:     linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        tsu.yubo@...il.com
Subject: [PATCH -next] fs/btrfs: Fix unlocking in btrfs_ref_tree_mod

It adds spin_lock() in add_block_entry() but out path does not unlock
it.

Detected by CoversityScan, CID# 1463343:(Missing unlock)

Fixes: fd708b81d972a (Btrfs: add a extent ref verify tool)
Signed-off-by: Bo YU <tsu.yubo@...il.com>
---
 fs/btrfs/ref-verify.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index 7887317033c9..8f644511006d 100644
--- a/fs/btrfs/ref-verify.c
+++ b/fs/btrfs/ref-verify.c
@@ -894,8 +894,10 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
 out_unlock:
 	spin_unlock(&fs_info->ref_verify_lock);
 out:
-	if (ret)
+	if (ret) {
+		spin_unlock(&fs_info->ref_verify_lock);
 		btrfs_clear_opt(fs_info->mount_opt, REF_VERIFY);
+	}
 	return ret;
 }

--
2.11.0

Powered by blists - more mailing lists