summaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-05-12 13:27:20 +0200
committerDavid S. Miller <davem@davemloft.net>2011-05-12 23:30:49 +0200
commit517aa0bcda9b092a4c3fab7bf93f0cebe372ece0 (patch)
tree28edc7ce3bd99465ae0eca4294ebd98dd4bbdb25 /net/sctp
parentl2tp: fix potential rcu race (diff)
downloadlinux-517aa0bcda9b092a4c3fab7bf93f0cebe372ece0.tar.xz
linux-517aa0bcda9b092a4c3fab7bf93f0cebe372ece0.zip
sctp: sctp_sendmsg: Don't initialize default_sinfo
This variable only needs initialization when cmsgs.info is NULL. Use memset to ensure padding is also zeroed so kernel doesn't leak any data. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 33d9ee629b4e..d4b8db177e27 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1496,7 +1496,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct sctp_chunk *chunk;
union sctp_addr to;
struct sockaddr *msg_name = NULL;
- struct sctp_sndrcvinfo default_sinfo = { 0 };
+ struct sctp_sndrcvinfo default_sinfo;
struct sctp_sndrcvinfo *sinfo;
struct sctp_initmsg *sinit;
sctp_assoc_t associd = 0;
@@ -1760,6 +1760,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
/* If the user didn't specify SNDRCVINFO, make up one with
* some defaults.
*/
+ memset(&default_sinfo, 0, sizeof(default_sinfo));
default_sinfo.sinfo_stream = asoc->default_stream;
default_sinfo.sinfo_flags = asoc->default_flags;
default_sinfo.sinfo_ppid = asoc->default_ppid;