TPM and string_to_uuid 64bits issue

Bug #462225 reported by dti
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
eCryptfs
Fix Released
Wishlist
Dustin Kirkland 

Bug Description

There is an issue running on 64b arch. and using TPM.
(Credit goes to Janos)
Patch to fix :

diff -urp ecryptfs-utils-81-orig/src/key_mod/ecryptfs_key_mod_tspi.c ecryptfs-utils-81-patched/src/key_mod/ecryptfs_key_mod_tspi.c
--- ecryptfs-utils-81-orig/src/key_mod/ecryptfs_key_mod_tspi.c 2009-09-08 18:10:56.000000000 +0200
+++ ecryptfs-utils-81-patched/src/key_mod/ecryptfs_key_mod_tspi.c 2009-10-21 17:40:24.000000000 +0200
@@ -542,17 +542,16 @@ static uint32_t tspi_num_params = 1;
  */
 static void string_to_uuid(TSS_UUID *uuid, char *str)
 {
- BYTE tmp[(sizeof(unsigned long) * 2 + 1)];
- unsigned long l;
- uint32_t i;
+ BYTE tmp[(sizeof(uint32_t) * 2 + 1)];
+ uint32_t i, l;

- tmp[sizeof(unsigned long) * 2] = '\0';
+ tmp[sizeof(uint32_t) * 2] = '\0';
        for (i = 0; i < (sizeof(TSS_UUID) * 2);
- i += (sizeof(unsigned long) * 2)) {
- memcpy(tmp, &str[i], sizeof(unsigned long) * 2);
+ i += (sizeof(uint32_t) * 2)) {
+ memcpy(tmp, &str[i], sizeof(uint32_t) * 2);
                l = strtoul((char *)tmp, NULL, 16);
                l = htonl(l);
- memcpy(&((BYTE *)uuid)[i/2], &l, sizeof(unsigned long));
+ memcpy(&((BYTE *)uuid)[i/2], &l, sizeof(uint32_t));
        }
 }

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Tyler, any objections here?

I'm inclined to apply this patch...

Changed in ecryptfs:
importance: Undecided → Wishlist
status: New → Triaged
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Tyler Hicks (tyhicks) wrote :

Dustin - No objections here. I was just helping someone in IRC who was on 64 bit Ubuntu and wasn't able to perform his mount without this patch. Lets go ahead and apply it.

Revision history for this message
dave2008 (dave2008713) wrote :

Why is this patch still not applied? I encountered the same problem here. :-)

Changed in ecryptfs:
status: Triaged → Confirmed
Changed in ecryptfs:
status: Confirmed → In Progress
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Fell through the cracks, unfortunately, Dave.

Committed revision 618. Will be in ecryptfs-utils-96.

Changed in ecryptfs:
status: In Progress → Fix Committed
Changed in ecryptfs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.