]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dccp: change L/R must have at least one byte in the dccpsf_val field
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 13 Aug 2008 20:48:39 +0000 (13:48 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Aug 2008 18:15:28 +0000 (11:15 -0700)
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>
net/dccp/proto.c

index c91d3c1fd30d4239018dd23c1c132680ab067435..c3e3acb2a158a2205f306d7f7b5f4db21cf6cc53 100644 (file)
@@ -477,6 +477,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)