[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#959661: buster-pu: package borgbackup/1.1.9-2+deb10u1



Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian.org@packages.debian.org
Usertags: pu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I’m proposing to upload an upstream patch fixing an index corruption in
borgbackup leading to a data loss, see #953615.

Please find the attached debdiff for more details.

- -- 
Cheers,
  Andrej

-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEEeuS9ZL8A0js0NGiOXkCM2RzYOdIFAl6u4mIUHGFuZHJld3No
QGRlYmlhbi5vcmcACgkQXkCM2RzYOdIhBQf+KwIkamu5+wYjmL3BjX6cUTZT1CjE
sDRhDDOpc5yd++T/I6G8xBrH3Iyu9oiPvXl4+hef7fH7/mLPciJxAEkFxRkWkd9a
VpjSKLdCzUkmBqPEDQ72U1a9vyAfLk1Q+VJuMkYGLOAWgqXDRewdlqJBx/zuGVG8
jVK86pNH3GL4Rizly2SPQrllrMsANF371iss/hgz0wUX3JvkyPGqLE4QrjCPfFAo
4d9cjwF6lP+oDYVpXqEYVotsXauNk5Xr3tW1inigFq1YBHSwlN6urspp54Di8lHC
qFqyJcwfoOnVIMREKQ3AB6UFj7BXJ8czaeO8JhemjLd5Go8rZu0EK0j81Q==
=icSL
-----END PGP SIGNATURE-----
diff --git a/debian/changelog b/debian/changelog
index 8e7373a9..db6133f9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+borgbackup (1.1.9-2+deb10u1) buster; urgency=medium
+
+  * Fix index corruption bug leading to data loss (Closes: #953615).
+
+ -- Andrej Shadura <andrewsh@debian.org>  Sun, 03 May 2020 17:20:28 +0200
+
 borgbackup (1.1.9-2) unstable; urgency=medium
 
   * Fix two lintian warnings:
diff --git a/debian/patches/fix-bug-in-hashindex_set-on-resize-fixes-4829.patch b/debian/patches/fix-bug-in-hashindex_set-on-resize-fixes-4829.patch
new file mode 100644
index 00000000..662d1b37
--- /dev/null
+++ b/debian/patches/fix-bug-in-hashindex_set-on-resize-fixes-4829.patch
@@ -0,0 +1,34 @@
+From 701159ac9da37d23b8079ebac8f87108c9e550da Mon Sep 17 00:00:00 2001
+From: Thomas Waldmann <tw@waldmann-edv.de>
+Date: Sun, 1 Mar 2020 16:31:32 +0100
+Subject: fix bug in hashindex_set on resize, fixes #4829
+
+the problem was that after a resize that was triggered by too few
+empty buckets, the rebuilt new hash table had entries at different
+positions than before, but the idx where to SET the entry was not
+recomputed afterwards.
+---
+ src/borg/_hashindex.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/borg/_hashindex.c b/src/borg/_hashindex.c
+index c7a5b0d0f..438c49906 100644
+--- a/src/borg/_hashindex.c
++++ b/src/borg/_hashindex.c
+@@ -562,6 +562,16 @@ hashindex_set(HashIndex *index, const void *key, const void *value)
+                 if(!hashindex_resize(index, index->num_buckets)) {
+                     return 0;
+                 }
++                /* we have just built a fresh hashtable and removed all tombstones,
++                 * so we only have EMPTY or USED buckets, but no DELETED ones any more.
++                 */
++                idx = start_idx = hashindex_index(index, key);
++                while(!BUCKET_IS_EMPTY(index, idx)) {
++                    idx++;
++                    if (idx >= index->num_buckets){
++                        idx -= index->num_buckets;
++                    }
++                }
+             }
+         }
+         ptr = BUCKET_ADDR(index, idx);
diff --git a/debian/patches/series b/debian/patches/series
index bd9e9747..3c8e4bfa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 privacy/0001-Remove-codecov.io-and-travis-ci.org-badges.patch
 privacy/0002-README.rst-Replace-img-src-with-text-link.patch
+fix-bug-in-hashindex_set-on-resize-fixes-4829.patch

Reply to: