Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

AFS: Correctly assemble the client UUID

Correctly assemble the client UUID by OR'ing in the flags rather than
assigning them over the other components.

Reported-by: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Howells and committed by
Linus Torvalds
0ef13515 1aab4d77

+2 -2
+2 -2
fs/afs/main.c
··· 55 55 afs_uuid.time_low = uuidtime; 56 56 afs_uuid.time_mid = uuidtime >> 32; 57 57 afs_uuid.time_hi_and_version = (uuidtime >> 48) & AFS_UUID_TIMEHI_MASK; 58 - afs_uuid.time_hi_and_version = AFS_UUID_VERSION_TIME; 58 + afs_uuid.time_hi_and_version |= AFS_UUID_VERSION_TIME; 59 59 60 60 get_random_bytes(&clockseq, 2); 61 61 afs_uuid.clock_seq_low = clockseq; 62 62 afs_uuid.clock_seq_hi_and_reserved = 63 63 (clockseq >> 8) & AFS_UUID_CLOCKHI_MASK; 64 - afs_uuid.clock_seq_hi_and_reserved = AFS_UUID_VARIANT_STD; 64 + afs_uuid.clock_seq_hi_and_reserved |= AFS_UUID_VARIANT_STD; 65 65 66 66 _debug("AFS UUID: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", 67 67 afs_uuid.time_low,