[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <YWPc8Stn3iBBNh80@kroah.com>
Date: Mon, 11 Oct 2021 08:42:57 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Vlad Yasevich <vyasevich@...il.com>,
Neil Horman <nhorman@...driver.com>,
Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, linux-sctp@...r.kernel.org,
netdev@...r.kernel.org,
Eiichi Tsukata <eiichi.tsukata@...anix.com>,
gregkh@...uxfoundation.org
Subject: [PATCH] sctp: account stream padding length for reconf chunk
From: Eiichi Tsukata <eiichi.tsukata@...anix.com>
"stream_len" is not always multiple of 4. Account padding length
which can be added in sctp_addto_chunk() for reconf chunk.
Cc: Vlad Yasevich <vyasevich@...il.com>
Cc: Neil Horman <nhorman@...driver.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Jakub Kicinski <kuba@...nel.org>
Cc: linux-sctp@...r.kernel.org
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Fixes: cc16f00f6529 ("sctp: add support for generating stream reconf ssn reset request chunk")
Reported-by: syzbot <syzkaller@...glegroups.com>
Cc: stable <stable@...r.kernel.org>
Signed-off-by: Eiichi Tsukata <eiichi.tsukata@...anix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
net/sctp/sm_make_chunk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index b8fa8f1a7277..f7a1072a2a2a 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3694,8 +3694,8 @@ struct sctp_chunk *sctp_make_strreset_req(
struct sctp_chunk *retval;
__u16 outlen, inlen;
- outlen = (sizeof(outreq) + stream_len) * out;
- inlen = (sizeof(inreq) + stream_len) * in;
+ outlen = (sizeof(outreq) + SCTP_PAD4(stream_len)) * out;
+ inlen = (sizeof(inreq) + SCTP_PAD4(stream_len)) * in;
retval = sctp_make_reconf(asoc, outlen + inlen);
if (!retval)
--
2.33.0
Powered by blists - more mailing lists