From f819561707805c46b1a67c35d8f9ae1eee420af3 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Tue, 18 Aug 2009 14:51:57 -0400 Subject: [PATCH] Fix stack corruption on 64 bit linux when md5inum is enabled Fix a stack overflow on 64 bit linux which corrupts the stack saved arguments and causes a kernel panic. This bug is seen on platforms where ino_t is 64 bits and the md5inum sysctl option is enabled. Reviewed-on: http://gerrit.openafs.org/322 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/afs/afs_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/afs/afs_util.c b/src/afs/afs_util.c index 9b46f00d4..8becfcf3c 100644 --- a/src/afs/afs_util.c +++ b/src/afs/afs_util.c @@ -596,7 +596,7 @@ afs_int32 afs_calc_inum (afs_int32 volume, afs_int32 vnode) AFS_MD5_Update(&ct, &volume, 4); AFS_MD5_Update(&ct, &vnode, 4); AFS_MD5_Final(digest, &ct); - memcpy(&ino, digest, sizeof(ino_t)); + memcpy(&ino, digest, sizeof(afs_int32)); ino ^= (ino ^ vno) & 1; } else { ino = (volume << 16) + vnode; -- 2.39.5