Commit 8bb04fb2 authored by Thorsten Blum's avatar Thorsten Blum Committed by Steve French

ksmbd: Replace one-element arrays with flexible-array members

Replace the deprecated one-element arrays with flexible-array members
in the structs copychunk_ioctl_req and smb2_ea_info_req.

There are no binary differences after this conversion.

Link: https://github.com/KSPP/linux/issues/79Signed-off-by: default avatarThorsten Blum <thorsten.blum@toblux.com>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 289ebd9a
...@@ -4587,7 +4587,7 @@ static int smb2_get_ea(struct ksmbd_work *work, struct ksmbd_file *fp, ...@@ -4587,7 +4587,7 @@ static int smb2_get_ea(struct ksmbd_work *work, struct ksmbd_file *fp,
path = &fp->filp->f_path; path = &fp->filp->f_path;
/* single EA entry is requested with given user.* name */ /* single EA entry is requested with given user.* name */
if (req->InputBufferLength) { if (req->InputBufferLength) {
if (le32_to_cpu(req->InputBufferLength) < if (le32_to_cpu(req->InputBufferLength) <=
sizeof(struct smb2_ea_info_req)) sizeof(struct smb2_ea_info_req))
return -EINVAL; return -EINVAL;
...@@ -8091,7 +8091,7 @@ int smb2_ioctl(struct ksmbd_work *work) ...@@ -8091,7 +8091,7 @@ int smb2_ioctl(struct ksmbd_work *work)
goto out; goto out;
} }
if (in_buf_len < sizeof(struct copychunk_ioctl_req)) { if (in_buf_len <= sizeof(struct copychunk_ioctl_req)) {
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
......
...@@ -194,7 +194,7 @@ struct copychunk_ioctl_req { ...@@ -194,7 +194,7 @@ struct copychunk_ioctl_req {
__le64 ResumeKey[3]; __le64 ResumeKey[3];
__le32 ChunkCount; __le32 ChunkCount;
__le32 Reserved; __le32 Reserved;
__u8 Chunks[1]; /* array of srv_copychunk */ __u8 Chunks[]; /* array of srv_copychunk */
} __packed; } __packed;
struct srv_copychunk { struct srv_copychunk {
...@@ -370,7 +370,7 @@ struct smb2_file_attr_tag_info { ...@@ -370,7 +370,7 @@ struct smb2_file_attr_tag_info {
struct smb2_ea_info_req { struct smb2_ea_info_req {
__le32 NextEntryOffset; __le32 NextEntryOffset;
__u8 EaNameLength; __u8 EaNameLength;
char name[1]; char name[];
} __packed; /* level 15 Query */ } __packed; /* level 15 Query */
struct smb2_ea_info { struct smb2_ea_info {
......
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