diff options
author | Stefan Metzmacher <metze@samba.org> | 2022-09-14 05:25:47 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-09-14 05:55:45 +0200 |
commit | bedc8f76b3539ac4f952114b316bcc2251e808ce (patch) | |
tree | 7459f5678cd94b2c88499249de5a1ee0abe6d0ae /fs/cifs/transport.c | |
parent | cifs: don't send down the destination address to sendmsg for a SOCK_STREAM (diff) | |
download | linux-bedc8f76b3539ac4f952114b316bcc2251e808ce.tar.xz linux-bedc8f76b3539ac4f952114b316bcc2251e808ce.zip |
cifs: always initialize struct msghdr smb_msg completely
So far we were just lucky because the uninitialized members
of struct msghdr are not used by default on a SOCK_STREAM tcp
socket.
But as new things like msg_ubuf and sg_from_iter where added
recently, we should play on the safe side and avoid potention
problems in future.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Cc: stable@vger.kernel.org
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to '')
-rw-r--r-- | fs/cifs/transport.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index a43c87c1d343..9a2753e21170 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -194,10 +194,6 @@ smb_send_kvec(struct TCP_Server_Info *server, struct msghdr *smb_msg, *sent = 0; - smb_msg->msg_name = NULL; - smb_msg->msg_namelen = 0; - smb_msg->msg_control = NULL; - smb_msg->msg_controllen = 0; if (server->noblocksnd) smb_msg->msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; else @@ -309,7 +305,7 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, sigset_t mask, oldmask; size_t total_len = 0, sent, size; struct socket *ssocket = server->ssocket; - struct msghdr smb_msg; + struct msghdr smb_msg = {}; __be32 rfc1002_marker; if (cifs_rdma_enabled(server)) { |