Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ef13515 authored by David Howells's avatar David Howells Committed by Linus Torvalds
Browse files

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: default avatarHimangi Saraogi <himangi774@gmail.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1aab4d77
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -55,13 +55,13 @@ static int __init afs_get_client_UUID(void)
	afs_uuid.time_low = uuidtime;
	afs_uuid.time_low = uuidtime;
	afs_uuid.time_mid = uuidtime >> 32;
	afs_uuid.time_mid = uuidtime >> 32;
	afs_uuid.time_hi_and_version = (uuidtime >> 48) & AFS_UUID_TIMEHI_MASK;
	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);
	get_random_bytes(&clockseq, 2);
	afs_uuid.clock_seq_low = clockseq;
	afs_uuid.clock_seq_low = clockseq;
	afs_uuid.clock_seq_hi_and_reserved =
	afs_uuid.clock_seq_hi_and_reserved =
		(clockseq >> 8) & AFS_UUID_CLOCKHI_MASK;
		(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",
	_debug("AFS UUID: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
	       afs_uuid.time_low,
	       afs_uuid.time_low,