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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210601100218.69842-1-tongtiangen@huawei.com>
Date:   Tue, 1 Jun 2021 18:02:18 +0800
From:   Tong Tiangen <tongtiangen@...wei.com>
To:     Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...hat.com>, <dm-devel@...hat.com>
CC:     <linux-kernel@...r.kernel.org>,
        Tong Tiangen <tongtiangen@...wei.com>
Subject: [PATCH -next] dm btree: shadow_child leaves unchecked in split_two_into_three

Function shadow_child() leaves variable 'r' unchecked in
split_two_into_three when parent_index not equals to 0.
It's also not coordinate with above relative codes.

Fixes: dee29bf9192b ("dm btree: improve btree residency")
Signed-off-by: Tong Tiangen <tongtiangen@...wei.com>
---
 drivers/md/persistent-data/dm-btree.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c
index 3e5a90580427..0703ca7a7d9a 100644
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -743,8 +743,10 @@ static int split_two_into_three(struct shadow_spine *s, unsigned parent_index,
 			return r;
 	} else {
 		middle_index = parent_index;
-		r = shadow_child(s->info, vt, pn, parent_index - 1, &left);
 		right = shadow_current(s);
+		r = shadow_child(s->info, vt, pn, parent_index - 1, &left);
+		if (r)
+			return r;
 	}
 
 	r = new_block(s->info, &middle);
-- 
2.18.0.huawei.25

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ