From: Marcelo Ricardo Leitner Date: Fri, 22 Jan 2016 20:29:49 +0000 (-0200) Subject: sctp: allow setting SCTP_SACK_IMMEDIATELY by the application X-Git-Tag: v3.16.35~387 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e4e69cbeebc2a1259094c645510e2fccc7e1ac8;p=thirdparty%2Fkernel%2Fstable.git sctp: allow setting SCTP_SACK_IMMEDIATELY by the application 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 Acked-by: Vlad Yasevich Signed-off-by: David S. Miller [ luis: backported to 3.16: - dropped changes to SCTP_SNDINFO case ] Signed-off-by: Luis Henriques --- diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 88c5befcb5698..70bac7a75b9c3 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -6464,6 +6464,7 @@ static int sctp_msghdr_parse(const struct msghdr *msg, sctp_cmsgs_t *cmsgs) /* 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;