aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/proto.c
diff options
context:
space:
mode:
authorTomasz Grobelny <tomasz@grobelny.oswiecenia.net>2010-12-04 07:39:13 -0500
committerGerrit Renker <gerrit@erg.abdn.ac.uk>2010-12-07 07:47:12 -0500
commit04910265078f08a73208beab70ed2a3cce4a919f (patch)
treecc7e1c927ceda1ddf5f86d50f8ee22a1a4e32fe6 /net/dccp/proto.c
parent871a2c16c21b988688b4ab1a78eadd969765c0a3 (diff)
dccp qpolicy: Parameter checking of cmsg qpolicy parameters
Ensure that cmsg->cmsg_type value is valid for qpolicy that is currently in use. Signed-off-by: Tomasz Grobelny <tomasz@grobelny.oswiecenia.net> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp/proto.c')
-rw-r--r--net/dccp/proto.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index d6a224982bb5..152975d942d9 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -726,6 +726,10 @@ static int dccp_msghdr_parse(struct msghdr *msg, struct sk_buff *skb)
726 if (cmsg->cmsg_level != SOL_DCCP) 726 if (cmsg->cmsg_level != SOL_DCCP)
727 continue; 727 continue;
728 728
729 if (cmsg->cmsg_type <= DCCP_SCM_QPOLICY_MAX &&
730 !dccp_qpolicy_param_ok(skb->sk, cmsg->cmsg_type))
731 return -EINVAL;
732
729 switch (cmsg->cmsg_type) { 733 switch (cmsg->cmsg_type) {
730 case DCCP_SCM_PRIORITY: 734 case DCCP_SCM_PRIORITY:
731 if (cmsg->cmsg_len != CMSG_LEN(sizeof(__u32))) 735 if (cmsg->cmsg_len != CMSG_LEN(sizeof(__u32)))