]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sctp: prevent info leak in sctp_make_heartbeat()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 29 Jun 2021 08:19:44 +0000 (11:19 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Jul 2021 18:16:38 +0000 (11:16 -0700)
The "hbinfo" struct has a 4 byte hole at the end so we have to zero it
out to prevent stack information from being disclosed.

Fixes: 01be45c4e72e ("sctp: do the basic send and recv for PLPMTUD probe")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/sm_make_chunk.c

index 6c08e5048d38397412ed45270762d0ddb5af21d5..b8fa8f1a727704df07e78c0b72e77a4ecdd76b76 100644 (file)
@@ -1163,7 +1163,7 @@ struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *asoc,
                                       const struct sctp_transport *transport,
                                       __u32 probe_size)
 {
-       struct sctp_sender_hb_info hbinfo;
+       struct sctp_sender_hb_info hbinfo = {};
        struct sctp_chunk *retval;
 
        retval = sctp_make_control(asoc, SCTP_CID_HEARTBEAT, 0,