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-Url: https://git.stricted.de/?a=commitdiff_plain;h=3e8a0a559c66ee9e7468195691a56fefc3589740;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 b622d9744856..1ca3b26eed0f 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)