Skip to content

Commit

Permalink
AFS: Correctly assemble the client UUID
Browse files Browse the repository at this point in the history
Correctly assemble the client UUID by OR'ing in the flags rather than
assigning them over the other components.

Reported-by: Himangi Saraogi <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dhowells authored and torvalds committed Jul 29, 2014
1 parent 1aab4d7 commit 0ef1351
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/afs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ static int __init afs_get_client_UUID(void)
afs_uuid.time_low = uuidtime;
afs_uuid.time_mid = uuidtime >> 32;
afs_uuid.time_hi_and_version = (uuidtime >> 48) & AFS_UUID_TIMEHI_MASK;
afs_uuid.time_hi_and_version = AFS_UUID_VERSION_TIME;
afs_uuid.time_hi_and_version |= AFS_UUID_VERSION_TIME;

get_random_bytes(&clockseq, 2);
afs_uuid.clock_seq_low = clockseq;
afs_uuid.clock_seq_hi_and_reserved =
(clockseq >> 8) & AFS_UUID_CLOCKHI_MASK;
afs_uuid.clock_seq_hi_and_reserved = AFS_UUID_VARIANT_STD;
afs_uuid.clock_seq_hi_and_reserved |= AFS_UUID_VARIANT_STD;

_debug("AFS UUID: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
afs_uuid.time_low,
Expand Down

0 comments on commit 0ef1351

Please sign in to comment.