From 3ebd7154ddf713309d23af2e906ad788e77f3222 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 4 Apr 2022 13:10:21 +0100 Subject: [PATCH] Rebase to new stable branch version 1.30.2 resolves: rhbz#2059289 Skip vsock tests unless the vsock_loopback module is loaded (2069558) --- ...ninitialized-values-when-computing-p.patch | 71 ------------------- nbdkit.spec | 11 +-- sources | 4 +- 3 files changed, 8 insertions(+), 78 deletions(-) delete mode 100644 0001-vddk-Don-t-use-uninitialized-values-when-computing-p.patch diff --git a/0001-vddk-Don-t-use-uninitialized-values-when-computing-p.patch b/0001-vddk-Don-t-use-uninitialized-values-when-computing-p.patch deleted file mode 100644 index 142ac90..0000000 --- a/0001-vddk-Don-t-use-uninitialized-values-when-computing-p.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 3578c005c8a2f479eb223bb89f7b0fba22d13766 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 22 Mar 2022 11:04:56 +0000 -Subject: [PATCH] vddk: Don't use uninitialized values when computing preferred - block size -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit 63d2dd2eb2 ("vddk: Export block size information for this -plugin") tried to calculate the preferred block size from the logical -and physical sector size reported by VDDK. Unfortunately VDDK < 7’s -VixDiskLib_GetInfo API returns a struct which does not contain -these fields at all. We knew about this already because the -debug code does not print them, but the block size code uses -them regardless of the VDDK version. - -The practical result of this error was that sometimes (depending on -existing contents of memory) you would see the error: - -nbdkit: vddk[1]: error: plugin must set preferred block size to a power of 2 - -Fix this by only using the fields when VDDK >= 7, and in earlier -versions assuming VDDK’s normal sector size. - -Reported-by: Xiaodai Wang -Fixes: commit 63d2dd2eb2c9980a07841fe84ec16844085a59c3 -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2066655 -(cherry picked from commit 31bc5322b179545bef827022e1ae3b7859387b1b) ---- - plugins/vddk/vddk.c | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - -diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c -index 5d31b073..51ef8f33 100644 ---- a/plugins/vddk/vddk.c -+++ b/plugins/vddk/vddk.c -@@ -855,6 +855,7 @@ vddk_block_size (void *handle, - { - struct vddk_handle *h = handle; - VixDiskLibInfo *info; -+ uint32_t logicalSectorSize, physicalSectorSize; - struct command info_cmd = { .type = INFO, .ptr = &info }; - - if (send_command_and_wait (h, &info_cmd) == -1) -@@ -862,8 +863,20 @@ vddk_block_size (void *handle, - - /* VDDK can only serve whole 512 byte sectors. */ - *minimum = VIXDISKLIB_SECTOR_SIZE; -- *preferred = MAX (MAX (info->logicalSectorSize, info->physicalSectorSize), -- 4096); -+ -+ /* The logicalSectorSize and physicalSectorSize fields are only -+ * present in VDDK >= 7. In earlier versions they will not be -+ * initialized and contain random values (beyond the end of the -+ * returned structure). So compute sector sizes with this in mind. -+ */ -+ logicalSectorSize = physicalSectorSize = VIXDISKLIB_SECTOR_SIZE; -+ if (library_version >= 7) { -+ logicalSectorSize = info->logicalSectorSize; -+ physicalSectorSize = info->physicalSectorSize; -+ } -+ -+ *preferred = MAX (MAX (logicalSectorSize, physicalSectorSize), 4096); -+ - *maximum = 0xffffffff; - - VDDK_CALL_START (VixDiskLib_FreeInfo, "info") --- -2.31.1 - diff --git a/nbdkit.spec b/nbdkit.spec index 738025a..52277a7 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -52,8 +52,8 @@ ExclusiveArch: x86_64 %global source_directory 1.30-stable Name: nbdkit -Version: 1.30.1 -Release: 2%{?dist} +Version: 1.30.2 +Release: 1%{?dist} Summary: NBD server License: BSD @@ -78,7 +78,7 @@ Source3: copy-patches.sh # https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-9.1/ # Patches. -Patch0001: 0001-vddk-Don-t-use-uninitialized-values-when-computing-p.patch +# (none) # For automatic RPM Provides generation. # See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html @@ -1178,8 +1178,8 @@ export LIBGUESTFS_TRACE=1 %changelog -* Tue Mar 22 2022 Richard W.M. Jones - 1.30.1-2 -- Rebase to new stable branch version 1.30.1 +* Mon Apr 04 2022 Richard W.M. Jones - 1.30.2-1 +- Rebase to new stable branch version 1.30.2 resolves: rhbz#2059289 - Add automatic provides generator and subpackage nbdkit-srpm-macros resolves: rhbz#2059291 @@ -1187,6 +1187,7 @@ export LIBGUESTFS_TRACE=1 - Fix license of bash-completion subpackage - vddk: Fix use of uninitialized memory when computing block size resolves: rhbz#2066655 +- Skip vsock tests unless the vsock_loopback module is loaded (2069558) * Mon Jan 24 2022 Richard W.M. Jones - 1.28.5-1 - Rebase to new stable branch version 1.28.5 diff --git a/sources b/sources index 9fccb5b..4009f4c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.30.1.tar.gz) = 433016b43e192fb07697af0b357aa817b46af811494762a8d38a5d7d8edfeb155451b7e1a35062dda10cc2bf9b19865a3faa5b781bd8cf1a121e7088582b586d -SHA512 (nbdkit-1.30.1.tar.gz.sig) = 7148c52779f345bfa515f1dfb38ed8e6efdc8b89e8d7a51b966c3b6fb5ffe48f74d114038ef3215d5ca7c3a206c11cc3946ebc90971647a52e71fdfaed902ee8 +SHA512 (nbdkit-1.30.2.tar.gz) = 84da92005bbb59a860c9ba5a88082d859c9dd4f9db5c81d8760e9d6925e10d80d27de78be9391113bf715d16de7726594b5b803512cd8b59ce14ec135fc4b09d +SHA512 (nbdkit-1.30.2.tar.gz.sig) = c64ccdbc25f56626360aa812af330e33f26e6954415b93976f5a3d58808affdc94efa6e309066b23dbfd354192c4693a408b79aa583a6f5e84ab1c2ef406179e