Blame SOURCES/0004-Fix-double-free-in-write_escrow_data_file.patch

61580b
From 7a0e344d0642f76992c943158621d8ee7e5caea3 Mon Sep 17 00:00:00 2001
61580b
From: Vojtech Trefny <vtrefny@redhat.com>
61580b
Date: Tue, 15 Nov 2022 13:21:25 +0100
61580b
Subject: [PATCH 1/2] crypto: Fix GError overwrite from libvolume_key
61580b
61580b
---
61580b
 src/plugins/crypto.c | 7 ++++---
61580b
 1 file changed, 4 insertions(+), 3 deletions(-)
61580b
61580b
diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
61580b
index 35c38410..9064c8e3 100644
61580b
--- a/src/plugins/crypto.c
61580b
+++ b/src/plugins/crypto.c
61580b
@@ -2552,13 +2552,14 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
61580b
     GIOChannel *out_file = NULL;
61580b
     GIOStatus status = G_IO_STATUS_ERROR;
61580b
     gsize bytes_written = 0;
61580b
+    GError *l_error = NULL;
61580b
 
61580b
     packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, secret_type, cert,
61580b
-                                                                     ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, error);
61580b
-
61580b
+                                                                     ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, &l_error);
61580b
     if (!packet_data) {
61580b
         g_set_error (error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_ESCROW_FAILED,
61580b
-                     "Failed to get escrow data");
61580b
+                     "Failed to get escrow data: %s", l_error->message);
61580b
+        g_clear_error (&l_error);
61580b
         libvk_volume_free (volume);
61580b
         return FALSE;
61580b
     }
61580b
-- 
61580b
2.38.1
61580b
61580b
61580b
From 25bf34c4c03e37eb3782dfccf459b9a3f795ddb3 Mon Sep 17 00:00:00 2001
61580b
From: Vojtech Trefny <vtrefny@redhat.com>
61580b
Date: Wed, 16 Nov 2022 10:26:06 +0100
61580b
Subject: [PATCH 2/2] crypto: Fix double free in write_escrow_data_file
61580b
61580b
---
61580b
 src/plugins/crypto.c | 1 -
61580b
 1 file changed, 1 deletion(-)
61580b
61580b
diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
61580b
index 9064c8e3..2086209e 100644
61580b
--- a/src/plugins/crypto.c
61580b
+++ b/src/plugins/crypto.c
61580b
@@ -2560,7 +2560,6 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
61580b
         g_set_error (error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_ESCROW_FAILED,
61580b
                      "Failed to get escrow data: %s", l_error->message);
61580b
         g_clear_error (&l_error);
61580b
-        libvk_volume_free (volume);
61580b
         return FALSE;
61580b
     }
61580b
 
61580b
-- 
61580b
2.38.1
61580b