Commit 41d2edf9 authored by Steve French's avatar Steve French Committed by Jiri Slaby

SMB3: GUIDs should be constructed as random but valid uuids

commit fa70b87c upstream.

GUIDs although random, and 16 bytes, need to be generated as
proper uuids.

[js] no create_durable_v2_buf in 3.12 yet
Signed-off-by: default avatarSteve French <steve.french@primarydata.com>
Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
Reported-by: default avatarDavid Goebels <davidgoe@microsoft.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent ab74f261
......@@ -260,7 +260,7 @@ cifs_alloc_inode(struct super_block *sb)
cifs_inode->createtime = 0;
cifs_inode->epoch = 0;
#ifdef CONFIG_CIFS_SMB2
get_random_bytes(cifs_inode->lease_key, SMB2_LEASE_KEY_SIZE);
generate_random_uuid(cifs_inode->lease_key);
#endif
/*
* Can not set i_flags here - they get immediately overwritten to zero
......
......@@ -2147,7 +2147,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
memcpy(&tcp_ses->dstaddr, &volume_info->dstaddr,
sizeof(tcp_ses->dstaddr));
#ifdef CONFIG_CIFS_SMB2
get_random_bytes(tcp_ses->client_guid, SMB2_CLIENT_GUID_SIZE);
generate_random_uuid(tcp_ses->client_guid);
#endif
/*
* at this point we are the only ones with the pointer
......
......@@ -595,7 +595,7 @@ smb2_set_lease_key(struct inode *inode, struct cifs_fid *fid)
static void
smb2_new_lease_key(struct cifs_fid *fid)
{
get_random_bytes(fid->lease_key, SMB2_LEASE_KEY_SIZE);
generate_random_uuid(fid->lease_key);
}
#define SMB2_SYMLINK_STRUCT_SIZE \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment