From ef9f965a626eae7966c9d8cefd7c81e58bd12bce Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 30 2017 13:46:06 +0000 Subject: import cryptsetup-1.7.4-3.el7_4.1 --- diff --git a/SOURCES/cryptsetup-1.7.6-fix-blockwise-access-functions-for-64k-page-size.patch b/SOURCES/cryptsetup-1.7.6-fix-blockwise-access-functions-for-64k-page-size.patch new file mode 100644 index 0000000..2c82dff --- /dev/null +++ b/SOURCES/cryptsetup-1.7.6-fix-blockwise-access-functions-for-64k-page-size.patch @@ -0,0 +1,50 @@ +diff -rupN cryptsetup-1.7.4.bcp/lib/utils.c cryptsetup-1.7.4/lib/utils.c +--- cryptsetup-1.7.4.bcp/lib/utils.c 2017-10-18 11:39:01.694902755 +0200 ++++ cryptsetup-1.7.4/lib/utils.c 2017-10-18 11:48:16.584868357 +0200 +@@ -252,21 +252,21 @@ ssize_t write_lseek_blockwise(int fd, in + if (!frontPadBuf) + goto out; + +- r = read_buffer(fd, frontPadBuf, bsize); +- if (r < 0 || r != bsize) +- goto out; +- + innerCount = bsize - frontHang; + if (innerCount > count) + innerCount = count; + ++ r = read_buffer(fd, frontPadBuf, bsize); ++ if (r < (frontHang + innerCount)) ++ goto out; ++ + memcpy(frontPadBuf + frontHang, buf, innerCount); + + if (lseek(fd, offset - frontHang, SEEK_SET) < 0) + goto out; + +- r = write_buffer(fd, frontPadBuf, bsize); +- if (r < 0 || r != bsize) ++ r = write_buffer(fd, frontPadBuf, frontHang + innerCount); ++ if (r != (frontHang + innerCount)) + goto out; + + buf = (char*)buf + innerCount; +@@ -311,14 +311,14 @@ ssize_t read_lseek_blockwise(int fd, int + if (!frontPadBuf) + return ret; + +- r = read_buffer(fd, frontPadBuf, bsize); +- if (r < 0 || r != bsize) +- goto out; +- + innerCount = bsize - frontHang; + if (innerCount > count) + innerCount = count; + ++ r = read_buffer(fd, frontPadBuf, bsize); ++ if (r < (frontHang + innerCount)) ++ goto out; ++ + memcpy(buf, frontPadBuf + frontHang, innerCount); + + buf = (char*)buf + innerCount; diff --git a/SPECS/cryptsetup.spec b/SPECS/cryptsetup.spec index 02b1dac..6525c83 100644 --- a/SPECS/cryptsetup.spec +++ b/SPECS/cryptsetup.spec @@ -5,7 +5,7 @@ Summary: A utility for setting up encrypted disks Name: cryptsetup Version: 1.7.4 -Release: 3%{?dist} +Release: 3%{?dist}.1 License: GPLv2+ and LGPLv2+ Group: Applications/System URL: https://gitlab.com/cryptsetup/cryptsetup @@ -26,6 +26,7 @@ Source0: https://www.kernel.org/pub/linux/utils/cryptsetup/v1.6/cryptsetup-%{ups Patch0: %{name}-avoid-rh-kernel-bug.patch Patch1: %{name}-1.7.5-fix-unaligned-access-to-hidden-truecrypt.patch Patch2: %{name}-1.7.5-fix-luksformat-in-fips-mode.patch +Patch3: %{name}-1.7.6-fix-blockwise-access-functions-for-64k-page-size.patch %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %define configure_cipher --enable-gcrypt-pbkdf2 @@ -114,6 +115,7 @@ for setting up disk encryption using dm-crypt kernel module. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 chmod -x python/pycryptsetup-test.py %if %{python3_enable} @@ -209,6 +211,11 @@ install -m755 misc/dracut_90reencrypt/reencrypt.sh %{buildroot}/%{dracutmodulesd %clean %changelog +* Thu Nov 16 2017 Ondrej Kozina - 1.7.4-3.el7_4.1 +- patch: fix regression in blockwise functions (archs with 64 KiB + page_size) +- Resolves: #1510841 + * Tue Apr 25 2017 Ondrej Kozina - 1.7.4-3 - patch: fix luksFormat failure while running in FIPS mode. - Resolves: #1444137