[PATCH 3.2 10/67] sctp: allow setting SCTP_SACK_IMMEDIATELY by the application
From: Ben Hutchings
Date: Tue Feb 23 2016 - 17:04:55 EST
3.2.78-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Ricardo Leitner <marcelo.leitner@xxxxxxxxx>
commit 27f7ed2b11d42ab6d796e96533c2076ec220affc upstream.
This patch extends commit b93d6471748d ("sctp: implement the sender side
for SACK-IMMEDIATELY extension") as it didn't white list
SCTP_SACK_IMMEDIATELY on sctp_msghdr_parse(), causing it to be
understood as an invalid flag and returning -EINVAL to the application.
Note that the actual handling of the flag is already there in
sctp_datamsg_from_user().
https://tools.ietf.org/html/rfc7053#section-7
Fixes: b93d6471748d ("sctp: implement the sender side for SACK-IMMEDIATELY extension")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@xxxxxxxxx>
Acked-by: Vlad Yasevich <vyasevich@xxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
[bwh: Backported to 3.2: drop the second hunk as we don't have SCTP_SNDINFO
cmsg support]
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
net/sctp/socket.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -6241,6 +6241,7 @@ SCTP_STATIC int sctp_msghdr_parse(const
/* Minimally, validate the sinfo_flags. */
if (cmsgs->info->sinfo_flags &
~(SCTP_UNORDERED | SCTP_ADDR_OVER |
+ SCTP_SACK_IMMEDIATELY |
SCTP_ABORT | SCTP_EOF))
return -EINVAL;
break;