summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2008-08-13 13:48:39 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-08-20 11:05:04 -0700
commitfcdf47f94c53c5d39927831fb45725df47f4547c (patch)
tree6a1bd3a97fe70196809cd0e949fc8fe320fb87c2 /net
parent90cc576c1fbfbee4d4e1ada7d877c46969c7cd3b (diff)
dccp: change L/R must have at least one byte in the dccpsf_val field
commit 3e8a0a559c66ee9e7468195691a56fefc3589740 upstream Thanks to Eugene Teo for reporting this problem. Signed-off-by: Eugene Teo <eugeneteo@kernel.sg> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/proto.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 9dfe2470962c..ebfd56b912f9 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -476,6 +476,11 @@ static int dccp_setsockopt_change(struct sock *sk, int type,
if (copy_from_user(&opt, optval, sizeof(opt)))
return -EFAULT;
+ /*
+ * rfc4340: 6.1. Change Options
+ */
+ if (opt.dccpsf_len < 1)
+ return -EINVAL;
val = kmalloc(opt.dccpsf_len, GFP_KERNEL);
if (!val)