DCCP: Fix exploitable hole in DCCP socket options
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>
Thu, 29 Mar 2007 18:57:36 +0000 (11:57 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 6 Apr 2007 10:43:13 +0000 (03:43 -0700)
commit4eb3dd593742225da375596564aca6aca2470999
tree0029cede1551a4fe889ded312c9fffb7707aa2a3
parent6fcc93a729a1830abfee7ce3065a4dd750c1c6b1
DCCP: Fix exploitable hole in DCCP socket options

[DCCP] getsockopt: Fix DCCP_SOCKOPT_[SEND,RECV]_CSCOV

We were only checking if there was enough space to put the int, but
left len as specified by the (malicious) user, sigh, fix it by setting
len to sizeof(val) and transfering just one int worth of data, the one
asked for.

Also check for negative len values.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/dccp/proto.c