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.27-rc4~103^2~30 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e8a0a559c66ee9e7468195691a56fefc3589740;p=linux-2.6 dccp: change L/R must have at least one byte in the dccpsf_val field 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 --- diff --git a/net/dccp/proto.c b/net/dccp/proto.c index b622d97448..1ca3b26eed 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c @@ -474,6 +474,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)