backport patch from community
(cherry picked from commit 96d6f52f42603883a42dd00476336a8443d0810e)
This commit is contained in:
parent
9c92fa34ee
commit
61f6062724
@ -0,0 +1,44 @@
|
||||
From f3c2ade90acbd1ac9a9391ff8e09fbe252a63b45 Mon Sep 17 00:00:00 2001
|
||||
From: Ming-Hung Tsai <mtsai@redhat.com>
|
||||
Date: Tue, 12 Oct 2021 23:19:00 +0800
|
||||
Subject: [PATCH] [thin_ll_dump] Fix potential segfault while reading invalid
|
||||
subtree roots
|
||||
|
||||
---
|
||||
thin-provisioning/thin_ll_dump.cc | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/thin-provisioning/thin_ll_dump.cc b/thin-provisioning/thin_ll_dump.cc
|
||||
index e6048d0..9207cd2 100644
|
||||
--- a/thin-provisioning/thin_ll_dump.cc
|
||||
+++ b/thin-provisioning/thin_ll_dump.cc
|
||||
@@ -135,7 +135,9 @@ namespace {
|
||||
public:
|
||||
ll_mapping_tree_emitter(block_manager::ptr bm,
|
||||
indented_stream &out)
|
||||
- : bm_(bm), out_(out) {
|
||||
+ : bm_(bm),
|
||||
+ nv_(create_btree_node_validator()),
|
||||
+ out_(out) {
|
||||
}
|
||||
|
||||
void visit(btree_path const &path, block_address tree_root) {
|
||||
@@ -147,6 +149,7 @@ namespace {
|
||||
try {
|
||||
block_manager::read_ref rr = bm_->read_lock(tree_root);
|
||||
node_ref<uint64_traits> n = btree_detail::to_node<uint64_traits>(rr);
|
||||
+ nv_->check(n.raw(), tree_root);
|
||||
node_info ni;
|
||||
convert_to_node_info(n, ni);
|
||||
output_node_info(out_, ni);
|
||||
@@ -160,6 +163,7 @@ namespace {
|
||||
}
|
||||
private:
|
||||
block_manager::ptr bm_;
|
||||
+ bcache::validator::ptr nv_;
|
||||
indented_stream& out_;
|
||||
};
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
Name: thin-provisioning-tools
|
||||
Version: 0.9.0
|
||||
Release: 3
|
||||
Release: 4
|
||||
Summary: Tools for manipulating Device-mapper metadata
|
||||
License: GPLv3+
|
||||
URL: https://github.com/jthornber/thin-provisioning-tools
|
||||
Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}.tar.gz
|
||||
Patch1: 0001-device-mapper-persistent-data-avoid-strip.patch
|
||||
Patch2: 0002-build-remove-lboost_iostreams-linker-flag.patch
|
||||
Patch3: 0003-thin_ll_dump-Fix-potential-segfault-while-reading-in.patch
|
||||
|
||||
BuildRequires: autoconf, expat-devel
|
||||
BuildRequires: libaio-devel, libstdc++-devel
|
||||
@ -51,6 +52,9 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install
|
||||
%{_mandir}/man*/*
|
||||
|
||||
%changelog
|
||||
* Fri Nov 4 2022 wuguanghao <wuguanghao3@huawei.com> - 0.9.0-4
|
||||
- backport bugfix patch from community
|
||||
|
||||
* Wed Sep 15 2021 Liu Zixian <liuzixian4@huawei.com> - 0.9.0-3
|
||||
- Remove redundant dependency
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user