[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5b7e4d0463a70beef9fb64c79cdc4793ca80af4c.1478523828.git.jslaby@suse.cz>
Date: Mon, 7 Nov 2016 14:04:57 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Steve French <smfrench@...il.com>,
Steve French <steve.french@...marydata.com>,
Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 3.12 50/72] SMB3: GUIDs should be constructed as random but valid uuids
From: Steve French <smfrench@...il.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fa70b87cc6641978b20e12cc5d517e9ffc0086d4 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: Steve French <steve.french@...marydata.com>
Reviewed-by: Aurelien Aptel <aaptel@...e.com>
Reported-by: David Goebels <davidgoe@...rosoft.com>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
fs/cifs/cifsfs.c | 2 +-
fs/cifs/connect.c | 2 +-
fs/cifs/smb2ops.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 16714b0661a8..037b8f7e8a94 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -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
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 7bdcf8fbc1ff..54f507bd2c09 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -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
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index a3a7a52aef04..6f74de30bd29 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -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 \
--
2.10.2
Powered by blists - more mailing lists