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

Bug#772046: marked as done (unblock: tcplay/1.1-2)



Your message dated Thu, 04 Dec 2014 19:21:36 +0000
with message-id <1417720896.10998.35.camel@adam-barratt.org.uk>
and subject line Re: Bug#772046: unblock: tcplay/1.1-2
has caused the Debian Bug report #772046,
regarding unblock: tcplay/1.1-2
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
772046: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772046
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Hi Release Team,

Please unblock the recent upload of tcplay as it fixes a data corruption
bug[1] on 4k sector drives. Upstream commit[2] is backported to the 1.1
release. Debdiff is attached.

Thanks,
Laszlo/GCS

unblock tcplay/1.1-2

[1] https://bugs.debian.org/771719
[2] https://github.com/bwalex/tc-play/commit/cf654c225a06d661c2c4a4996206a62464c9484f
diff -Nru tcplay-1.1/debian/changelog tcplay-1.1/debian/changelog
--- tcplay-1.1/debian/changelog	2013-09-01 09:40:44.000000000 +0000
+++ tcplay-1.1/debian/changelog	2014-12-03 06:55:21.000000000 +0000
@@ -1,3 +1,11 @@
+tcplay (1.1-2) unstable; urgency=high
+
+  * Backport upstream fix to prevent data loss on 4k sector drives
+    (closes: #771719).
+  * Update Standards-Version to 3.9.6 .
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org>  Mon, 01 Dec 2014 21:40:29 +0000
+
 tcplay (1.1-1) unstable; urgency=low
 
   * New upstream release (closes: #719836).
diff -Nru tcplay-1.1/debian/control tcplay-1.1/debian/control
--- tcplay-1.1/debian/control	2013-09-01 10:01:37.000000000 +0000
+++ tcplay-1.1/debian/control	2014-12-01 21:49:50.000000000 +0000
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Laszlo Boszormenyi (GCS) <gcs@debian.org>
 Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), cmake, pkg-config, libdevmapper-dev, libudev-dev, uuid-dev, libgcrypt11-dev
-Standards-Version: 3.9.4
+Standards-Version: 3.9.6
 Homepage: https://github.com/bwalex/tc-play
 
 Package: tcplay
diff -Nru tcplay-1.1/debian/patches/cf654c225a06d661c2c4a4996206a62464c9484f.patch tcplay-1.1/debian/patches/cf654c225a06d661c2c4a4996206a62464c9484f.patch
--- tcplay-1.1/debian/patches/cf654c225a06d661c2c4a4996206a62464c9484f.patch	1970-01-01 00:00:00.000000000 +0000
+++ tcplay-1.1/debian/patches/cf654c225a06d661c2c4a4996206a62464c9484f.patch	2014-12-01 21:54:06.000000000 +0000
@@ -0,0 +1,383 @@
+From cf654c225a06d661c2c4a4996206a62464c9484f Mon Sep 17 00:00:00 2001
+From: Alex Hornung <alex@alexhornung.com>
+Date: Mon, 11 Nov 2013 20:57:28 +0000
+Subject: [PATCH] (hopefully) fix mapping for 4k sector size disks and volumes
+
+ * while on it, also add a unit (sectors) to block and iv offset
+   when printed.
+
+Fixes #45
+---
+
+--- tcplay-1.1.orig/tcplay.c
++++ tcplay-1.1/tcplay.c
+@@ -342,8 +342,10 @@ print_info(struct tcplay_info *info)
+ 	printf("Vol Flags:\t\t%d\n", info->volflags);
+ #endif
+ 
+-	printf("IV offset:\t\t%"PRIu64"\n", (uint64_t)info->skip);
+-	printf("Block offset:\t\t%"PRIu64"\n", (uint64_t)info->offset);
++	printf("IV offset:\t\t%"PRIu64" sectors\n",
++	    (uint64_t)info->skip);
++	printf("Block offset:\t\t%"PRIu64" sectors\n",
++	    (uint64_t)info->offset);
+ }
+ 
+ static
+@@ -368,6 +370,7 @@ new_info(const char *dev, int flags, str
+ 	info->pbkdf_prf = prf;
+ 	info->start = start;
+ 	info->hdr = hdr;
++	info->blk_sz = hdr->sec_sz;
+ 	info->size = hdr->sz_mk_scope / hdr->sec_sz;	/* volume size */
+ 	info->skip = hdr->off_mk_scope / hdr->sec_sz;	/* iv skip */
+ 
+@@ -1574,6 +1577,7 @@ dm_info_map(const char *map_name)
+ 	info->size = dm_table[0]->size;
+ 	info->skip = dm_table[outermost]->skip;
+ 	info->offset = dm_table[outermost]->offset;
++	info->blk_sz = 512;
+ 
+ 	return info;
+ 
+@@ -1657,8 +1661,13 @@ dm_setup(const char *mapname, struct tcp
+ 	}
+ 
+ 	strcpy(dev, info->dev);
+-	start = info->start;
+-	offset = info->offset;
++
++	/*
++	 * Device Mapper blocks are always 512-byte blocks, so convert
++	 * from the "native" block size to the dm block size here.
++	 */
++	start = INFO_TO_DM_BLOCKS(info, start);
++	offset = INFO_TO_DM_BLOCKS(info, offset);
+ 	uu_stack_idx = 0;
+ 
+ 	/*
+@@ -1756,25 +1765,29 @@ dm_setup(const char *mapname, struct tcp
+ 			/* dev---^       block off --^ */
+ 			snprintf(params, 512, "%s 0", dev);
+ 
+-			if ((dm_task_add_target(dmt, 0, info->offset, "linear", params)) == 0) {
++			if ((dm_task_add_target(dmt, 0,
++				INFO_TO_DM_BLOCKS(info, offset),
++				"linear", params)) == 0) {
+ 				tc_log(1, "dm_task_add_target failed\n");
+ 				ret = -1;
+ 				goto out;
+ 			}
+ 
+-			start = info->offset;
++			start = INFO_TO_DM_BLOCKS(info, offset);
+ 		}
+ 
+ 		/* aes-cbc-essiv:sha256 7997f8af... 0 /dev/ad0s0a 8 */
+ 		/*			   iv off---^  block off--^ */
+ 		snprintf(params, 512, "%s %s %"PRIu64 " %s %"PRIu64,
+ 		    cipher_chain->cipher->dm_crypt_str, cipher_chain->dm_key,
+-		    (uint64_t)info->skip, dev, (uint64_t)offset);
++		    (uint64_t)INFO_TO_DM_BLOCKS(info, skip), dev,
++		    (uint64_t)offset);
+ #ifdef DEBUG
+ 		printf("Params: %s\n", params);
+ #endif
+ 
+-		if ((dm_task_add_target(dmt, start, info->size, "crypt", params)) == 0) {
++		if ((dm_task_add_target(dmt, start,
++		    INFO_TO_DM_BLOCKS(info, size), "crypt", params)) == 0) {
+ 			tc_log(1, "dm_task_add_target failed\n");
+ 			ret = -1;
+ 			goto out;
+--- tcplay-1.1.orig/tcplay.h
++++ tcplay-1.1/tcplay.h
+@@ -79,6 +79,8 @@
+ #include <uuid/uuid.h>
+ #endif
+ 
++typedef uint64_t disksz_t;
++
+ struct pbkdf_prf_algo {
+ 	const char *name;
+ 	int iteration_count;
+@@ -139,11 +141,13 @@ struct tcplay_info {
+ 	int flags;
+ 	int volflags;
+ 
+-	off_t start;	/* Logical volume offset in table */
+-	size_t size;	/* Volume size */
++	uint32_t blk_sz;
++
++	off_t start;	/* Logical volume offset in table (in blk_sz blocks) */
++	disksz_t size;	/* Volume size (in blk_sz blocks) */
+ 
+-	off_t skip;	/* IV offset */
+-	off_t offset;	/* Block offset */
++	off_t skip;	/* IV offset (in blk_sz blocks) */
++	off_t offset;	/* Block offset (in blk_sz blocks) */
+ 
+ 	/* Populated by dm_setup */
+ 	uuid_t uuid;
+@@ -151,6 +155,9 @@ struct tcplay_info {
+ 	int hidden;
+ };
+ 
++#define INFO_TO_DM_BLOCKS(info, memb) \
++    (((info)->memb * (uint64_t)((info)->blk_sz))/512)
++
+ struct tcplay_dm_table {
+ 	char device[PATH_MAX];	/* Underlying device */
+ 	char target[256];	/* DM Target type */
+--- tcplay-1.1.orig/tcplay_api.c
++++ tcplay-1.1/tcplay_api.c
+@@ -271,9 +271,9 @@ tc_api_info_mapped_volume(tc_api_opts *a
+ 	    info->cipher_chain);
+ 	vol_info->tc_key_bits = 8*tc_cipher_chain_klen(info->cipher_chain);
+ 	strncpy(vol_info->tc_prf, "(unknown)", sizeof(vol_info->tc_prf));
+-	vol_info->tc_size = info->size * (size_t)512;
+-	vol_info->tc_iv_offset = info->skip * (off_t)512;
+-	vol_info->tc_block_offset = info->offset * (off_t)512;
++	vol_info->tc_size = info->size * (size_t)info->blk_sz;
++	vol_info->tc_iv_offset = info->skip * (off_t)info->blk_sz;
++	vol_info->tc_block_offset = info->offset * (off_t)info->blk_sz;
+ 	strncpy(vol_info->tc_device, info->dev, sizeof(vol_info->tc_device));
+ 	vol_info->tc_device[sizeof(vol_info->tc_device)-1] = '\0';
+ 
+--- tcplay-1.1.orig/test/features/create_vol_cli.feature
++++ tcplay-1.1/test/features/create_vol_cli.feature
+@@ -20,8 +20,8 @@ Feature: Command line volume creation
+       | Key Length         | 512 bits          |
+       | Sector size        | 512               |
+       | Volume size        | 19968 sectors     |
+-      | IV offset          | 256               |
+-      | Block offset       | 256               |
++      | IV offset          | 256 sectors       |
++      | Block offset       | 256 sectors       |
+ 
+   Scenario: Cascade volume #1
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -43,8 +43,8 @@ Feature: Command line volume creation
+       | Key Length         | 1024 bits                   |
+       | Sector size        | 512                         |
+       | Volume size        | 19968 sectors               |
+-      | IV offset          | 256                         |
+-      | Block offset       | 256                         |
++      | IV offset          | 256 sectors                 |
++      | Block offset       | 256 sectors                 |
+ 
+   Scenario: Hidden volume #1
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -70,8 +70,8 @@ Feature: Command line volume creation
+       | Key Length         | 512 bits                    |
+       | Sector size        | 512                         |
+       | Volume size        | 19968 sectors               |
+-      | IV offset          | 256                         |
+-      | Block offset       | 256                         |
++      | IV offset          | 256 sectors                 |
++      | Block offset       | 256 sectors                 |
+ 
+   Scenario: Hidden volume #2
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -97,8 +97,8 @@ Feature: Command line volume creation
+       | Key Length         | 512 bits                    |
+       | Sector size        | 512                         |
+       | Volume size        | 4096 sectors                |
+-      | IV offset          | 16128                       |
+-      | Block offset       | 16128                       |
++      | IV offset          | 16128 sectors               |
++      | Block offset       | 16128 sectors               |
+ 
+   Scenario: Hidden volume #3
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -127,5 +127,5 @@ Feature: Command line volume creation
+       | Key Length         | 512 bits                    |
+       | Sector size        | 512                         |
+       | Volume size        | 4096 sectors                |
+-      | IV offset          | 16128                       |
+-      | Block offset       | 16128                       |
++      | IV offset          | 16128 sectors               |
++      | Block offset       | 16128 sectors               |
+--- tcplay-1.1.orig/test/features/modify_vol_cli.feature
++++ tcplay-1.1/test/features/modify_vol_cli.feature
+@@ -24,8 +24,8 @@ Feature: Command line volume modificatio
+       | Key Length         | 512 bits          |
+       | Sector size        | 512               |
+       | Volume size        | 19968 sectors     |
+-      | IV offset          | 256               |
+-      | Block offset       | 256               |
++      | IV offset          | 256 sectors       |
++      | Block offset       | 256 sectors       |
+ 
+   Scenario: Simple volume #1 (change PBKDF PRF)
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -51,8 +51,8 @@ Feature: Command line volume modificatio
+       | Key Length         | 512 bits          |
+       | Sector size        | 512               |
+       | Volume size        | 19968 sectors     |
+-      | IV offset          | 256               |
+-      | Block offset       | 256               |
++      | IV offset          | 256 sectors       |
++      | Block offset       | 256 sectors       |
+ 
+   Scenario: Cascade volume #1 (change passphrase)
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -77,8 +77,8 @@ Feature: Command line volume modificatio
+       | Key Length         | 1024 bits                   |
+       | Sector size        | 512                         |
+       | Volume size        | 19968 sectors               |
+-      | IV offset          | 256                         |
+-      | Block offset       | 256                         |
++      | IV offset          | 256 sectors                 |
++      | Block offset       | 256 sectors                 |
+ 
+   Scenario: Hidden volume #1 (change passphrase)
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -107,8 +107,8 @@ Feature: Command line volume modificatio
+       | Key Length         | 512 bits                    |
+       | Sector size        | 512                         |
+       | Volume size        | 19968 sectors               |
+-      | IV offset          | 256                         |
+-      | Block offset       | 256                         |
++      | IV offset          | 256 sectors                 |
++      | Block offset       | 256 sectors                 |
+ 
+   Scenario: Hidden volume #2 (change passphrase, keyfiles)
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -140,8 +140,8 @@ Feature: Command line volume modificatio
+       | Key Length         | 512 bits                    |
+       | Sector size        | 512                         |
+       | Volume size        | 4096 sectors                |
+-      | IV offset          | 16128                       |
+-      | Block offset       | 16128                       |
++      | IV offset          | 16128 sectors               |
++      | Block offset       | 16128 sectors               |
+ 
+   Scenario: Hidden volume #3 (change keyfiles, PBKDF PRF)
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -171,8 +171,8 @@ Feature: Command line volume modificatio
+       | Key Length         | 512 bits                    |
+       | Sector size        | 512                         |
+       | Volume size        | 4096 sectors                |
+-      | IV offset          | 16128                       |
+-      | Block offset       | 16128                       |
++      | IV offset          | 16128 sectors               |
++      | Block offset       | 16128 sectors               |
+ 
+   Scenario: Hidden volume #4 (restore from backup, outer)
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -201,8 +201,8 @@ Feature: Command line volume modificatio
+       | Key Length         | 512 bits                    |
+       | Sector size        | 512                         |
+       | Volume size        | 19968 sectors               |
+-      | IV offset          | 256                         |
+-      | Block offset       | 256                         |
++      | IV offset          | 256 sectors                 |
++      | Block offset       | 256 sectors                 |
+ 
+   Scenario: Hidden volume #5 (restore from backup, hidden)
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -231,5 +231,5 @@ Feature: Command line volume modificatio
+       | Key Length         | 512 bits                    |
+       | Sector size        | 512                         |
+       | Volume size        | 4096 sectors                |
+-      | IV offset          | 16128                       |
+-      | Block offset       | 16128                       |
++      | IV offset          | 16128 sectors               |
++      | Block offset       | 16128 sectors               |
+--- tcplay-1.1.orig/test/features/passphrase_64_cli.feature
++++ tcplay-1.1/test/features/passphrase_64_cli.feature
+@@ -18,8 +18,8 @@ Feature: Passphrase 64-byte limitation u
+       | Key Length         | 512 bits          |
+       | Sector size        | 512               |
+       | Volume size        | 1536 sectors      |
+-      | IV offset          | 256               |
+-      | Block offset       | 256               |
++      | IV offset          | 256 sectors       |
++      | Block offset       | 256 sectors       |
+ 
+   Scenario: Long passphrase TrueCrypt-created volume mapping with trimming
+     Given I map volume test_long.tc as tcplay_test using the following settings:
+@@ -38,8 +38,8 @@ Feature: Passphrase 64-byte limitation u
+       | Key Length         | 512 bits          |
+       | Sector size        | 512               |
+       | Volume size        | 1536 sectors      |
+-      | IV offset          | 256               |
+-      | Block offset       | 256               |
++      | IV offset          | 256 sectors       |
++      | Block offset       | 256 sectors       |
+ 
+   Scenario: Long passphrase volume creation
+     Given I create a volume tmpvol1 of size 10M with the following parameters:
+@@ -60,5 +60,5 @@ Feature: Passphrase 64-byte limitation u
+       | Key Length         | 512 bits          |
+       | Sector size        | 512               |
+       | Volume size        | 19968 sectors     |
+-      | IV offset          | 256               |
+-      | Block offset       | 256               |
++      | IV offset          | 256 sectors       |
++      | Block offset       | 256 sectors       |
+--- tcplay-1.1.orig/test/features/vol_test1_cli.feature
++++ tcplay-1.1/test/features/vol_test1_cli.feature
+@@ -12,8 +12,8 @@ Feature: Command line mapping/info tests
+       | Cipher             | AES-256-XTS        |
+       | Key Length         | 512 bits           |
+       | Volume size        | 40448 sectors      |
+-      | IV offset          | 256                |
+-      | Block offset       | 256                |
++      | IV offset          | 256 sectors        |
++      | Block offset       | 256 sectors        |
+ 
+ 
+ 
+@@ -28,8 +28,8 @@ Feature: Command line mapping/info tests
+       | Cipher             | AES-256-XTS        |
+       | Key Length         | 512 bits           |
+       | Volume size        | 10240 sectors      |
+-      | IV offset          | 30464              |
+-      | Block offset       | 30464              |
++      | IV offset          | 30464 sectors      |
++      | Block offset       | 30464 sectors      |
+ 
+ 
+ 
+@@ -46,5 +46,5 @@ Feature: Command line mapping/info tests
+       | Cipher             | AES-256-XTS        |
+       | Key Length         | 512 bits           |
+       | Volume size        | 30208 sectors      |
+-      | IV offset          | 256                |
+-      | Block offset       | 256                |
++      | IV offset          | 256 sectors        |
++      | Block offset       | 256 sectors        |
+--- tcplay-1.1.orig/test/features/vol_test2_cli.feature
++++ tcplay-1.1/test/features/vol_test2_cli.feature
+@@ -14,8 +14,8 @@ Feature: Command line mapping/info tests
+       | Cipher             | SERPENT-256-XTS,TWOFISH-256-XTS,AES-256-XTS |
+       | Key Length         | 1536 bits                                   |
+       | Volume size        | 9728 sectors                                |
+-      | IV offset          | 256                                         |
+-      | Block offset       | 256                                         |
++      | IV offset          | 256 sectors                                 |
++      | Block offset       | 256 sectors                                 |
+ 
+ 
+ 
+@@ -32,8 +32,8 @@ Feature: Command line mapping/info tests
+       | Cipher             | SERPENT-256-XTS,TWOFISH-256-XTS             |
+       | Key Length         | 1024 bits                                   |
+       | Volume size        | 2040 sectors                                |
+-      | IV offset          | 7936                                        |
+-      | Block offset       | 7936                                        |
++      | IV offset          | 7936 sectors                                |
++      | Block offset       | 7936 sectors                                |
+ 
+ 
+ 
+@@ -53,5 +53,5 @@ Feature: Command line mapping/info tests
+       | Cipher             | SERPENT-256-XTS,TWOFISH-256-XTS,AES-256-XTS |
+       | Key Length         | 1536 bits                                   |
+       | Volume size        | 7688 sectors                                |
+-      | IV offset          | 256                                         |
+-      | Block offset       | 256                                         |
++      | IV offset          | 256 sectors                                 |
++      | Block offset       | 256 sectors                                 |
diff -Nru tcplay-1.1/debian/patches/series tcplay-1.1/debian/patches/series
--- tcplay-1.1/debian/patches/series	2013-09-01 09:50:05.000000000 +0000
+++ tcplay-1.1/debian/patches/series	2014-12-01 21:54:12.000000000 +0000
@@ -1,2 +1,3 @@
 #use_ldflags.patch
 do_not_add_lib_suffix.patch
+cf654c225a06d661c2c4a4996206a62464c9484f.patch

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
On Thu, 2014-12-04 at 18:02 +0100, Laszlo Boszormenyi (GCS) wrote:
> Package: release.debian.org
> Severity: normal
> User: release.debian.org@packages.debian.org
> Usertags: unblock
> 
> Hi Release Team,
> 
> Please unblock the recent upload of tcplay as it fixes a data corruption
> bug[1] on 4k sector drives. Upstream commit[2] is backported to the 1.1
> release. Debdiff is attached.

Unblocked, thanks.

Regards,

Adam

--- End Message ---

Reply to: