Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965149AbcCIX12 (ORCPT ); Wed, 9 Mar 2016 18:27:28 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:41195 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934508AbcCIXTG (ORCPT ); Wed, 9 Mar 2016 18:19:06 -0500 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Marcelo Ricardo Leitner , "David S . Miller" , Luis Henriques , Kamal Mostafa Subject: [PATCH 3.13.y-ckt 120/138] sctp: allow setting SCTP_SACK_IMMEDIATELY by the application Date: Wed, 9 Mar 2016 15:14:07 -0800 Message-Id: <1457565265-15195-121-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457565265-15195-1-git-send-email-kamal@canonical.com> References: <1457565265-15195-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.13 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1639 Lines: 45 3.13.11-ckt36 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Marcelo Ricardo Leitner 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 Signed-off-by: Kamal Mostafa --- net/sctp/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d486356..fdd6a8305 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -6436,6 +6436,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; -- 2.7.0