From: Arnaldo Carvalho de Melo Date: Wed, 13 Aug 2008 20:48:39 +0000 (-0700) Subject: dccp: change L/R must have at least one byte in the dccpsf_val field X-Git-Tag: v2.6.26.3~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcdf47f94c53c5d39927831fb45725df47f4547c;p=platform%2Fkernel%2Flinux-stable.git 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 Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Gerrit Renker Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- 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)